HDFS-7857. Improve authentication failure WARN message to avoid user confusion. Contributed by Yongjun Zhang.
This commit is contained in:
parent
b3e699271b
commit
d799fbe1cc
@ -1324,10 +1324,15 @@ private void saslProcess(RpcSaslProto saslMessage)
|
|||||||
saslResponse = processSaslMessage(saslMessage);
|
saslResponse = processSaslMessage(saslMessage);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
rpcMetrics.incrAuthenticationFailures();
|
rpcMetrics.incrAuthenticationFailures();
|
||||||
|
if (LOG.isDebugEnabled()) {
|
||||||
|
LOG.debug(StringUtils.stringifyException(e));
|
||||||
|
}
|
||||||
// attempting user could be null
|
// attempting user could be null
|
||||||
|
IOException tce = (IOException) getTrueCause(e);
|
||||||
AUDITLOG.warn(AUTH_FAILED_FOR + this.toString() + ":"
|
AUDITLOG.warn(AUTH_FAILED_FOR + this.toString() + ":"
|
||||||
+ attemptingUser + " (" + e.getLocalizedMessage() + ")");
|
+ attemptingUser + " (" + e.getLocalizedMessage()
|
||||||
throw (IOException) getTrueCause(e);
|
+ ") with true cause: (" + tce.getLocalizedMessage() + ")");
|
||||||
|
throw tce;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (saslServer != null && saslServer.isComplete()) {
|
if (saslServer != null && saslServer.isComplete()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user