You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by to...@apache.org on 2023/02/21 00:34:03 UTC
[hadoop] branch branch-3.3 updated: HDFS-16925. Namenode audit log to only include IP address of client (#5413)
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 <vj...@apache.org>
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 <ta...@apache.org>
Signed-off-by: Tao Li <to...@apache.org>
---
.../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: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org