karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject karaf git commit: [KARAF-3413]should also associate the role to run executeScript
Date Fri, 12 Dec 2014 09:05:09 GMT
Repository: karaf
Updated Branches:
  refs/heads/karaf-2.x 3648bc22f -> 26452988c


[KARAF-3413]should also associate the role to run executeScript


Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/26452988
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/26452988
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/26452988

Branch: refs/heads/karaf-2.x
Commit: 26452988ceb1d11a9f76c88796b3eea24d6cb05c
Parents: 3648bc2
Author: Freeman Fang <freeman.fang@gmail.com>
Authored: Fri Dec 12 17:04:48 2014 +0800
Committer: Freeman Fang <freeman.fang@gmail.com>
Committed: Fri Dec 12 17:04:48 2014 +0800

----------------------------------------------------------------------
 .../java/org/apache/karaf/shell/ssh/ShellCommandFactory.java    | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/26452988/shell/ssh/src/main/java/org/apache/karaf/shell/ssh/ShellCommandFactory.java
----------------------------------------------------------------------
diff --git a/shell/ssh/src/main/java/org/apache/karaf/shell/ssh/ShellCommandFactory.java b/shell/ssh/src/main/java/org/apache/karaf/shell/ssh/ShellCommandFactory.java
index ce6d3b6..365d715 100644
--- a/shell/ssh/src/main/java/org/apache/karaf/shell/ssh/ShellCommandFactory.java
+++ b/shell/ssh/src/main/java/org/apache/karaf/shell/ssh/ShellCommandFactory.java
@@ -110,10 +110,11 @@ public class ShellCommandFactory implements CommandFactory {
                     Object result;
                     if (subject != null) {
                         try {
-                            String scriptFileName = System.getProperty(SHELL_INIT_SCRIPT);
-                            executeScript(scriptFileName, session);
+                            
                             result = JaasHelper.doAs(subject, new PrivilegedExceptionAction<Object>()
{
                                 public Object run() throws Exception {
+                                    String scriptFileName = System.getProperty(SHELL_INIT_SCRIPT);
+                                    executeScript(scriptFileName, session);
                                     return session.execute(command);
                                 }
                             });


Mime
View raw message