zookeeper-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [zookeeper] enixon commented on a change in pull request #1049: ZOOKEEPER-3475 Enable Checkstyle configuration on zookeeper-server
Date Sun, 11 Aug 2019 19:54:56 GMT
enixon commented on a change in pull request #1049: ZOOKEEPER-3475 Enable Checkstyle configuration
on zookeeper-server
URL: https://github.com/apache/zookeeper/pull/1049#discussion_r312752065
 
 

 ##########
 File path: zookeeper-server/src/main/java/org/apache/zookeeper/server/ZooKeeperServer.java
 ##########
 @@ -1476,34 +1527,34 @@ private void processSasl(ByteBuffer incomingBuffer, ServerCnxn cnxn,
                 if (saslServer.isComplete()) {
                     String authorizationID = saslServer.getAuthorizationID();
                     LOG.info("adding SASL authorization for authorizationID: " + authorizationID);
-                    cnxn.addAuthInfo(new Id("sasl",authorizationID));
-                    if (System.getProperty("zookeeper.superUser") != null &&
-                        authorizationID.equals(System.getProperty("zookeeper.superUser")))
{
+                    cnxn.addAuthInfo(new Id("sasl", authorizationID));
+                    if (System.getProperty("zookeeper.superUser") != null
+                            && authorizationID.equals(System.getProperty("zookeeper.superUser")))
{
                         cnxn.addAuthInfo(new Id("super", ""));
                     }
                 }
             } catch (SaslException e) {
                 LOG.warn("Client {} failed to SASL authenticate: {}",
-                    cnxn.getRemoteSocketAddress(), e);
+                        cnxn.getRemoteSocketAddress(), e);
                 if (shouldAllowSaslFailedClientsConnect() && !shouldRequireClientSaslAuth())
{
-                  LOG.warn("Maintaining client connection despite SASL authentication failure.");
+                    LOG.warn("Maintaining client connection despite SASL authentication failure.");
                 } else {
-                  int error;
-                  if (shouldRequireClientSaslAuth()) {
-                    LOG.warn("Closing client connection due to server requires client SASL
authenticaiton," +
-                        "but client SASL authentication has failed, or client is not configured
with SASL " +
-                        "authentication.");
-                    error = Code.SESSIONCLOSEDREQUIRESASLAUTH.intValue();
-                  } else {
-                    LOG.warn("Closing client connection due to SASL authentication failure.");
-                    error = Code.AUTHFAILED.intValue();
-                  }
-
-                  ReplyHeader replyHeader = new ReplyHeader(requestHeader.getXid(), 0, error);
-                  cnxn.sendResponse(replyHeader, new SetSASLResponse(null), "response");
-                  cnxn.sendCloseSession();
-                  cnxn.disableRecv();
-                  return;
+                    int error;
+                    if (shouldRequireClientSaslAuth()) {
+                        LOG.warn("Closing client connection due to server requires client
SASL authenticaiton,"
 
 Review comment:
   Mind fixing the spelling "authenticaiton" while you're at it? :)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message