HADOOP-6781. security audit log shouldn't have exception in it.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@946815 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Boris Shkolnik 2010-05-20 23:11:08 +00:00
parent 78778a158c
commit f4998a7813
3 changed files with 6 additions and 4 deletions

View File

@ -23,6 +23,8 @@ Trunk (unreleased changes)
BUG FIXES
HADOOP-6781. security audit log shouldn't have exception in it.
HADOOP-6612. Protocols RefreshUserToGroupMappingsProtocol and
RefreshAuthorizationPolicyProtocol will fail with security enabled (boryas)

View File

@ -111,7 +111,7 @@ public abstract class Server {
static int INITIAL_RESP_BUF_SIZE = 10240;
public static final Log LOG = LogFactory.getLog(Server.class);
public static final Log auditLOG =
public static final Log AUDITLOG =
LogFactory.getLog("SecurityLogger."+Server.class.getName());
private static final String AUTH_FAILED_FOR = "Auth failed for ";
private static final String AUTH_SUCCESSFULL_FOR = "Auth successfull for ";
@ -995,7 +995,7 @@ public abstract class Server {
rpcMetrics.authenticationFailures.inc();
String clientIP = this.toString();
// attempting user could be null
auditLOG.warn(AUTH_FAILED_FOR + clientIP + ":" + attemptingUser, e);
AUDITLOG.warn(AUTH_FAILED_FOR + clientIP + ":" + attemptingUser);
throw e;
}
if (replyToken != null) {
@ -1013,7 +1013,7 @@ public abstract class Server {
user = getAuthorizedUgi(saslServer.getAuthorizationID());
LOG.info("SASL server successfully authenticated client: " + user);
rpcMetrics.authenticationSuccesses.inc();
auditLOG.info(AUTH_SUCCESSFULL_FOR + user);
AUDITLOG.info(AUTH_SUCCESSFULL_FOR + user);
saslContextEstablished = true;
}
} else {

View File

@ -242,7 +242,7 @@ public class MiniRPCBenchmark {
static void setLoggingLevel(Level level) {
LogManager.getLogger(Server.class.getName()).setLevel(level);
((Log4JLogger)Server.auditLOG).getLogger().setLevel(level);
((Log4JLogger)Server.AUDITLOG).getLogger().setLevel(level);
LogManager.getLogger(Client.class.getName()).setLevel(level);
}