You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zookeeper.apache.org by ma...@apache.org on 2013/09/28 01:21:18 UTC
svn commit: r1527122 - in /zookeeper/trunk: CHANGES.txt
src/java/main/org/apache/zookeeper/client/ZooKeeperSaslClient.java
Author: mahadev
Date: Fri Sep 27 23:21:17 2013
New Revision: 1527122
URL: http://svn.apache.org/r1527122
Log:
Reverting ZOOKEEPER-1696 patch that was committed.
Modified:
zookeeper/trunk/CHANGES.txt
zookeeper/trunk/src/java/main/org/apache/zookeeper/client/ZooKeeperSaslClient.java
Modified: zookeeper/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/zookeeper/trunk/CHANGES.txt?rev=1527122&r1=1527121&r2=1527122&view=diff
==============================================================================
--- zookeeper/trunk/CHANGES.txt (original)
+++ zookeeper/trunk/CHANGES.txt Fri Sep 27 23:21:17 2013
@@ -387,10 +387,6 @@ BUGFIXES:
which are used to ping RwServer (Rakesh R via fpj)
ZOOKEEPER-1096. Leader communication should listen on specified IP, not wildcard address (Jared Cantwell, German Blanco via fpj)
-
- ZOOKEEPER-1696. Fail to run zookeeper client on Weblogic application server.
- (Jeffrey Zhong via mahadev)
-
ZOOKEEPER-87. Follower does not shut itself down if its too far behind the leader. (German Blanco via fpj)
IMPROVEMENTS:
Modified: zookeeper/trunk/src/java/main/org/apache/zookeeper/client/ZooKeeperSaslClient.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/main/org/apache/zookeeper/client/ZooKeeperSaslClient.java?rev=1527122&r1=1527121&r2=1527122&view=diff
==============================================================================
--- zookeeper/trunk/src/java/main/org/apache/zookeeper/client/ZooKeeperSaslClient.java (original)
+++ zookeeper/trunk/src/java/main/org/apache/zookeeper/client/ZooKeeperSaslClient.java Fri Sep 27 23:21:17 2013
@@ -80,7 +80,6 @@ public class ZooKeeperSaslClient {
private static final Logger LOG = LoggerFactory.getLogger(ZooKeeperSaslClient.class);
private static Login login = null;
private SaslClient saslClient;
- private boolean isSASLConfigured = true;
private byte[] saslToken = new byte[0];
@@ -105,7 +104,7 @@ public class ZooKeeperSaslClient {
}
public ZooKeeperSaslClient(final String serverPrincipal)
- throws LoginException {
+ throws LoginException {
/**
* ZOOKEEPER-1373: allow system property to specify the JAAS
* configuration section that the zookeeper client should use.
@@ -114,12 +113,12 @@ public class ZooKeeperSaslClient {
String clientSection = System.getProperty(ZooKeeperSaslClient.LOGIN_CONTEXT_NAME_KEY, "Client");
// Note that 'Configuration' here refers to javax.security.auth.login.Configuration.
AppConfigurationEntry entries[] = null;
- RuntimeException runtimeException = null;
+ SecurityException securityException = null;
try {
entries = Configuration.getConfiguration().getAppConfigurationEntry(clientSection);
- } catch (RuntimeException e) {
+ } catch (SecurityException e) {
// handle below: might be harmless if the user doesn't intend to use JAAS authentication.
- runtimeException = e;
+ securityException = e;
}
if (entries != null) {
this.configStatus = "Will attempt to SASL-authenticate using Login Context section '" + clientSection + "'";
@@ -132,11 +131,11 @@ public class ZooKeeperSaslClient {
if (explicitClientSection != null) {
// If the user explicitly overrides the default Login Context, they probably expected SASL to
// succeed. But if we got here, SASL failed.
- if (runtimeException != null) {
+ if (securityException != null) {
throw new LoginException("Zookeeper client cannot authenticate using the " + explicitClientSection +
" section of the supplied JAAS configuration: '" +
System.getProperty(Environment.JAAS_CONF_KEY) + "' because of a " +
- "RuntimeException: " + runtimeException);
+ "SecurityException: " + securityException);
} else {
throw new LoginException("Client cannot SASL-authenticate because the specified JAAS configuration " +
"section '" + explicitClientSection + "' could not be found.");
@@ -145,22 +144,21 @@ public class ZooKeeperSaslClient {
// The user did not override the default context. It might be that they just don't intend to use SASL,
// so log at INFO, not WARN, since they don't expect any SASL-related information.
String msg = "Will not attempt to authenticate using SASL ";
- if (runtimeException != null) {
- msg += "(" + runtimeException.getLocalizedMessage() + ")";
+ if (securityException != null) {
+ msg += "(" + securityException.getLocalizedMessage() + ")";
} else {
msg += "(unknown error)";
}
this.configStatus = msg;
- this.isSASLConfigured = false;
}
if (System.getProperty(Environment.JAAS_CONF_KEY) != null) {
// Again, the user explicitly set something SASL-related, so they probably expected SASL to succeed.
- if (runtimeException != null) {
+ if (securityException != null) {
throw new LoginException("Zookeeper client cannot authenticate using the '" +
System.getProperty(ZooKeeperSaslClient.LOGIN_CONTEXT_NAME_KEY, "Client") +
"' section of the supplied JAAS configuration: '" +
System.getProperty(Environment.JAAS_CONF_KEY) + "' because of a " +
- "RuntimeException: " + runtimeException);
+ "SecurityException: " + securityException);
} else {
throw new LoginException("No JAAS configuration section named '" +
System.getProperty(ZooKeeperSaslClient.LOGIN_CONTEXT_NAME_KEY, "Client") +
@@ -170,7 +168,7 @@ public class ZooKeeperSaslClient {
}
}
}
-
+
/**
* @return informational message indicating the current configuration status.
*/
@@ -530,9 +528,6 @@ public class ZooKeeperSaslClient {
}
public boolean clientTunneledAuthenticationInProgress() {
- if (!isSASLConfigured) {
- return false;
- }
// TODO: Rather than checking a disjunction here, should be a single member
// variable or method in this class to determine whether the client is
// configured to use SASL. (see also ZOOKEEPER-1455).