Commit 6ef87886 authored by Patrick D. Hunt's avatar Patrick D. Hunt
Browse files

ZOOKEEPER-1811. The ZooKeeperSaslClient service name principal is hardcoded to...

ZOOKEEPER-1811. The ZooKeeperSaslClient service name principal is hardcoded to "zookeeper" (Harsh J via phunt)

git-svn-id: https://svn.apache.org/repos/asf/zookeeper/branches/branch-3.4@1566749 13f79535-47bb-0310-9956-ffa450edef68
parent cc1a3487
......@@ -238,6 +238,9 @@ BUGFIXES:
ZOOKEEPER-1573. Unable to load database due to missing parent node
(Vinayakumar B via phunt, fpj)
ZOOKEEPER-1811. The ZooKeeperSaslClient service name principal is
hardcoded to "zookeeper" (Harsh J via phunt)
IMPROVEMENTS:
ZOOKEEPER-1564. Allow JUnit test build with IBM Java
......
......@@ -85,6 +85,9 @@ import org.slf4j.LoggerFactory;
public class ClientCnxn {
private static final Logger LOG = LoggerFactory.getLogger(ClientCnxn.class);
private static final String ZK_SASL_CLIENT_USERNAME =
"zookeeper.sasl.client.username";
/** This controls whether automatic watch resetting is enabled.
* Clients automatically reset watches during session reconnect, this
* option allows the client to turn off this behavior by setting
......@@ -941,7 +944,11 @@ public class ClientCnxn {
"(" + addr.getHostName() + ":" + addr.getPort() + ")"));
if (ZooKeeperSaslClient.isEnabled()) {
try {
zooKeeperSaslClient = new ZooKeeperSaslClient("zookeeper/"+addr.getHostName());
String principalUserName = System.getProperty(
ZK_SASL_CLIENT_USERNAME, "zookeeper");
zooKeeperSaslClient =
new ZooKeeperSaslClient(
principalUserName+"/"+addr.getHostName());
} catch (LoginException e) {
// An authentication error occurred when the SASL client tried to initialize:
// for Kerberos this means that the client failed to authenticate with the KDC.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment