Skip to content

Commit 5b5f976

Browse files
committed
ZKUtil#isSecureZooKeeper should check more app configuration entries (Enis Söztutar)
1 parent e860c66 commit 5b5f976

File tree

1 file changed

+6
-3
lines changed
  • hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper

1 file changed

+6
-3
lines changed

hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,11 @@ public static boolean isSecureZooKeeper(Configuration conf) {
10011001
try {
10021002
javax.security.auth.login.Configuration testConfig =
10031003
javax.security.auth.login.Configuration.getConfiguration();
1004-
if(testConfig.getAppConfigurationEntry("Client") == null) {
1004+
if (testConfig.getAppConfigurationEntry("Client") == null
1005+
&& testConfig.getAppConfigurationEntry(
1006+
JaasConfiguration.CLIENT_KEYTAB_KERBEROS_CONFIG_NAME) == null
1007+
&& testConfig.getAppConfigurationEntry(
1008+
JaasConfiguration.SERVER_KEYTAB_KERBEROS_CONFIG_NAME) == null) {
10051009
return false;
10061010
}
10071011
} catch(Exception e) {
@@ -1010,8 +1014,7 @@ public static boolean isSecureZooKeeper(Configuration conf) {
10101014
}
10111015

10121016
// Master & RSs uses hbase.zookeeper.client.*
1013-
return("kerberos".equalsIgnoreCase(conf.get("hbase.security.authentication")) &&
1014-
conf.get("hbase.zookeeper.client.keytab.file") != null);
1017+
return("kerberos".equalsIgnoreCase(conf.get("hbase.security.authentication")));
10151018
}
10161019

10171020
private static ArrayList<ACL> createACL(ZooKeeperWatcher zkw, String node) {

0 commit comments

Comments
 (0)