From f4998a781376e1f15a2b72135eaa3db38bebde99 Mon Sep 17 00:00:00 2001 From: Boris Shkolnik Date: Thu, 20 May 2010 23:11:08 +0000 Subject: [PATCH] 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 --- CHANGES.txt | 2 ++ src/java/org/apache/hadoop/ipc/Server.java | 6 +++--- src/test/core/org/apache/hadoop/ipc/MiniRPCBenchmark.java | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 19b47a76b1..a688bcae2a 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -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) diff --git a/src/java/org/apache/hadoop/ipc/Server.java b/src/java/org/apache/hadoop/ipc/Server.java index 9339ca5e91..68697325de 100644 --- a/src/java/org/apache/hadoop/ipc/Server.java +++ b/src/java/org/apache/hadoop/ipc/Server.java @@ -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 Object run() throws SaslException { 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 Object run() throws SaslException { 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 { diff --git a/src/test/core/org/apache/hadoop/ipc/MiniRPCBenchmark.java b/src/test/core/org/apache/hadoop/ipc/MiniRPCBenchmark.java index fa429e4a01..14eac72b11 100644 --- a/src/test/core/org/apache/hadoop/ipc/MiniRPCBenchmark.java +++ b/src/test/core/org/apache/hadoop/ipc/MiniRPCBenchmark.java @@ -242,7 +242,7 @@ public MiniProtocol run() throws IOException { 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); }