karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbono...@apache.org
Subject svn commit: r1449633 - /karaf/trunk/shell/ssh/src/main/java/org/apache/karaf/shell/ssh/ShellCommand.java
Date Mon, 25 Feb 2013 09:55:12 GMT
Author: jbonofre
Date: Mon Feb 25 09:55:12 2013
New Revision: 1449633

URL: http://svn.apache.org/r1449633
Log:
[KARAF-1327] Move script execution hook to avoid certificate authentication bypass

Modified:
    karaf/trunk/shell/ssh/src/main/java/org/apache/karaf/shell/ssh/ShellCommand.java

Modified: karaf/trunk/shell/ssh/src/main/java/org/apache/karaf/shell/ssh/ShellCommand.java
URL: http://svn.apache.org/viewvc/karaf/trunk/shell/ssh/src/main/java/org/apache/karaf/shell/ssh/ShellCommand.java?rev=1449633&r1=1449632&r2=1449633&view=diff
==============================================================================
--- karaf/trunk/shell/ssh/src/main/java/org/apache/karaf/shell/ssh/ShellCommand.java (original)
+++ karaf/trunk/shell/ssh/src/main/java/org/apache/karaf/shell/ssh/ShellCommand.java Mon Feb
25 09:55:12 2013
@@ -82,8 +82,6 @@ public class ShellCommand implements Com
             final CommandSession session = commandProcessor.createSession(in, new PrintStream(out),
new PrintStream(err));
             session.put("SCOPE", "shell:osgi:*");
             session.put("APPLICATION", System.getProperty("karaf.name", "root"));
-            String scriptFileName = System.getProperty(SHELL_INIT_SCRIPT);
-            executeScript(scriptFileName, session);
             for (Map.Entry<String,String> e : env.getEnv().entrySet()) {
                 session.put(e.getKey(), e.getValue());
             }
@@ -92,6 +90,8 @@ public class ShellCommand implements Com
                 Object result;
                 if (subject != null) {
                     try {
+                        String scriptFileName = System.getProperty(SHELL_INIT_SCRIPT);
+                        executeScript(scriptFileName, session);
                         result = Subject.doAs(subject, new PrivilegedExceptionAction<Object>()
{
                             public Object run() throws Exception {
                                 return session.execute(command);
@@ -101,6 +101,8 @@ public class ShellCommand implements Com
                         throw e.getException();
                     }
                 } else {
+                    String scriptFileName = System.getProperty(SHELL_INIT_SCRIPT);
+                    executeScript(scriptFileName, session);
                     result = session.execute(command);
                 }
                 if (result != null)



Mime
View raw message