karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject git commit: [KARAF-132] The user name for the main console session is always “karaf”
Date Wed, 10 Sep 2014 12:22:44 GMT
Repository: karaf
Updated Branches:
  refs/heads/karaf-2.x fdb2957e8 -> 304787dae


[KARAF-132] The user name for the main console session is always “karaf”


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

Branch: refs/heads/karaf-2.x
Commit: 304787dae106f1d20727ac8e92097149f162b732
Parents: fdb2957
Author: Guillaume Nodet <gnodet@gmail.com>
Authored: Wed Sep 10 14:21:21 2014 +0200
Committer: Guillaume Nodet <gnodet@gmail.com>
Committed: Wed Sep 10 14:22:23 2014 +0200

----------------------------------------------------------------------
 .../org/apache/karaf/shell/console/jline/ConsoleFactory.java   | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/304787da/shell/console/src/main/java/org/apache/karaf/shell/console/jline/ConsoleFactory.java
----------------------------------------------------------------------
diff --git a/shell/console/src/main/java/org/apache/karaf/shell/console/jline/ConsoleFactory.java
b/shell/console/src/main/java/org/apache/karaf/shell/console/jline/ConsoleFactory.java
index 0bc2e3d..68cf181 100644
--- a/shell/console/src/main/java/org/apache/karaf/shell/console/jline/ConsoleFactory.java
+++ b/shell/console/src/main/java/org/apache/karaf/shell/console/jline/ConsoleFactory.java
@@ -98,7 +98,11 @@ public class ConsoleFactory {
     protected void start() throws Exception {
         if (start) {
             Subject subject = new Subject();
-            final String user = "karaf";
+            String userName = System.getProperty("karaf.local.user");
+            if (userName == null) {
+                userName = "karaf";
+            }
+            final String user = userName;
             subject.getPrincipals().add(new UserPrincipal(user));
             String roles = System.getProperty("karaf.local.roles");
             if (roles != null) {


Mime
View raw message