This is an automated email from the ASF dual-hosted git repository.
tomscut pushed a commit to branch branch-3.3
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/branch-3.3 by this push:
new e47ff5f3c05 HDFS-16925. Namenode audit log to only include IP address
of client (#5413)
e47ff5f3c05 is described below
commit e47ff5f3c05278b5735159d13fa3b2291f7528f4
Author: Viraj Jasani <[email protected]>
AuthorDate: Mon Feb 20 16:33:54 2023 -0800
HDFS-16925. Namenode audit log to only include IP address of client (#5413)
Reviewed-by: Takanobu Asanuma <[email protected]>
Signed-off-by: Tao Li <[email protected]>
---
.../main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git
a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
index aa00d05bad3..437ffab6727 100644
---
a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
+++
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
@@ -8506,9 +8506,10 @@ public class FSNamesystem implements Namesystem,
FSNamesystemMBean,
src = escapeJava(src);
dst = escapeJava(dst);
sb.setLength(0);
+ String ipAddr = addr != null ? "/" + addr.getHostAddress() : "null";
sb.append("allowed=").append(succeeded).append("\t")
.append("ugi=").append(userName).append("\t")
- .append("ip=").append(addr).append("\t")
+ .append("ip=").append(ipAddr).append("\t")
.append("cmd=").append(cmd).append("\t")
.append("src=").append(src).append("\t")
.append("dst=").append(dst).append("\t");
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]