accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [1/3] git commit: ACCUMULO-2058 Add shell env interpolation for ACCUMULO_CONF_DIR when extracting kerberos keytab value.
Date Wed, 18 Dec 2013 22:06:50 GMT
Updated Branches:
  refs/heads/1.6.0-SNAPSHOT f228caff4 -> 814813421


ACCUMULO-2058 Add shell env interpolation for ACCUMULO_CONF_DIR when extracting kerberos keytab
value.


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

Branch: refs/heads/1.6.0-SNAPSHOT
Commit: 559b18bc73225ea2cc779ec727c8f49b29ab2924
Parents: adee0f1
Author: Josh Elser <elserj@apache.org>
Authored: Wed Dec 18 16:30:31 2013 -0500
Committer: Josh Elser <elserj@apache.org>
Committed: Wed Dec 18 16:30:31 2013 -0500

----------------------------------------------------------------------
 .../org/apache/accumulo/server/security/SecurityUtil.java    | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/559b18bc/src/server/src/main/java/org/apache/accumulo/server/security/SecurityUtil.java
----------------------------------------------------------------------
diff --git a/src/server/src/main/java/org/apache/accumulo/server/security/SecurityUtil.java
b/src/server/src/main/java/org/apache/accumulo/server/security/SecurityUtil.java
index 94dcd1b..2d1ff53 100644
--- a/src/server/src/main/java/org/apache/accumulo/server/security/SecurityUtil.java
+++ b/src/server/src/main/java/org/apache/accumulo/server/security/SecurityUtil.java
@@ -29,6 +29,7 @@ import org.apache.log4j.Logger;
  */
 public class SecurityUtil {
   private static final Logger log = Logger.getLogger(SecurityUtil.class);
+  private static final String ACCUMULO_HOME = "ACCUMULO_HOME", ACCUMULO_CONF_DIR = "ACCUMULO_CONF_DIR";
 
   /**
    * This method is for logging a server in kerberos. If this is used in client code, it
will fail unless run as the accumulo keytab's owner. Instead, use
@@ -40,8 +41,11 @@ public class SecurityUtil {
     String keyTab = acuConf.get(Property.GENERAL_KERBEROS_KEYTAB);
     if (keyTab == null || keyTab.length() == 0)
       return;
-    if (keyTab.contains("$ACCUMULO_HOME") && System.getenv("ACCUMULO_HOME") != null)
-      keyTab = keyTab.replace("$ACCUMULO_HOME", System.getenv("ACCUMULO_HOME"));
+    if (keyTab.contains("$" + ACCUMULO_HOME) && System.getenv(ACCUMULO_HOME) != null)
+      keyTab = keyTab.replace("$" + ACCUMULO_HOME, System.getenv(ACCUMULO_HOME));
+    
+    if (keyTab.contains("$" + ACCUMULO_CONF_DIR) && System.getenv(ACCUMULO_CONF_DIR)
!= null)
+      keyTab = keyTab.replace("$" + ACCUMULO_CONF_DIR, System.getenv(ACCUMULO_CONF_DIR));
     
     String principalConfig = acuConf.get(Property.GENERAL_KERBEROS_PRINCIPAL);
     if (principalConfig == null || principalConfig.length() == 0)


Mime
View raw message