Github user eolivelli commented on a diff in the pull request:
https://github.com/apache/zookeeper/pull/457#discussion_r168302873
--- Diff: src/java/main/org/apache/zookeeper/server/ZooKeeperServer.java ---
@@ -1101,8 +1102,16 @@ public void processPacket(ServerCnxn cnxn,
ByteBuffer incomingBuffer) throws IOE
} else {
if (h.getType() == OpCode.sasl) {
Record rsp = processSasl(incomingBuffer,cnxn);
- ReplyHeader rh = new ReplyHeader(h.getXid(), 0,
KeeperException.Code.OK.intValue());
- cnxn.sendResponse(rh,rsp, "response"); // not sure about
3rd arg..what is it?
+ if (rsp == null) {
+ ReplyHeader rh = new ReplyHeader(h.getXid(), 0,
Code.AUTHFAILED.intValue());
+ cnxn.sendResponse(rh, new
SetSASLResponse(AUTHENTICATION_FAILED.getBytes()), "response"); // not sure
about 3rd arg..what is it?
+ LOG.warn("Closing client connection due to SASL
authentication failure.");
--- End diff --
Can we log at least the ip address of the client?
---