zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maha...@apache.org
Subject svn commit: r1527120 - in /zookeeper/branches/branch-3.4: CHANGES.txt src/java/main/org/apache/zookeeper/client/ZooKeeperSaslClient.java
Date Fri, 27 Sep 2013 23:17:08 GMT
Author: mahadev
Date: Fri Sep 27 23:17:07 2013
New Revision: 1527120

URL: http://svn.apache.org/r1527120
Log:
Reverting ZOOKEEPER-1696 patch that was committed.

Modified:
    zookeeper/branches/branch-3.4/CHANGES.txt
    zookeeper/branches/branch-3.4/src/java/main/org/apache/zookeeper/client/ZooKeeperSaslClient.java

Modified: zookeeper/branches/branch-3.4/CHANGES.txt
URL: http://svn.apache.org/viewvc/zookeeper/branches/branch-3.4/CHANGES.txt?rev=1527120&r1=1527119&r2=1527120&view=diff
==============================================================================
--- zookeeper/branches/branch-3.4/CHANGES.txt (original)
+++ zookeeper/branches/branch-3.4/CHANGES.txt Fri Sep 27 23:17:07 2013
@@ -109,9 +109,6 @@ BUGFIXES:
 
   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)
 
   ZOOKEEPER-1603. StaticHostProviderTest testUpdateClientMigrateOrNot hangs (fpj)

Modified: zookeeper/branches/branch-3.4/src/java/main/org/apache/zookeeper/client/ZooKeeperSaslClient.java
URL: http://svn.apache.org/viewvc/zookeeper/branches/branch-3.4/src/java/main/org/apache/zookeeper/client/ZooKeeperSaslClient.java?rev=1527120&r1=1527119&r2=1527120&view=diff
==============================================================================
--- zookeeper/branches/branch-3.4/src/java/main/org/apache/zookeeper/client/ZooKeeperSaslClient.java
(original)
+++ zookeeper/branches/branch-3.4/src/java/main/org/apache/zookeeper/client/ZooKeeperSaslClient.java
Fri Sep 27 23:17:07 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).



Mime
View raw message