You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "Íñigo Goiri (Jira)" <ji...@apache.org> on 2022/09/02 17:24:00 UTC

[jira] [Resolved] (HDFS-16750) NameNode should use NameNode.getRemoteUser() to log audit event to avoid possible NPE

     [ https://issues.apache.org/jira/browse/HDFS-16750?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Íñigo Goiri resolved HDFS-16750.
--------------------------------
    Fix Version/s: 3.4.0
     Hadoop Flags: Reviewed
       Resolution: Fixed

> NameNode should use NameNode.getRemoteUser() to log audit event to avoid possible NPE 
> --------------------------------------------------------------------------------------
>
>                 Key: HDFS-16750
>                 URL: https://issues.apache.org/jira/browse/HDFS-16750
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: ZanderXu
>            Assignee: ZanderXu
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 3.4.0
>
>
> NameNode should use NameNode.getRemoteUser() to log audit event to avoid possible NPE.
> The relate code is: 
> {code:java}
> private void logAuditEvent(boolean succeeded, String cmd, String src,
>     String dst, FileStatus stat) throws IOException {
>   if (isAuditEnabled() && isExternalInvocation()) {
>     logAuditEvent(succeeded, Server.getRemoteUser(), Server.getRemoteIp(),
>         cmd, src, dst, stat);
>   }
> }
> // the ugi may be null.
> private void logAuditEvent(boolean succeeded,
>     UserGroupInformation ugi, InetAddress addr, String cmd, String src,
>     String dst, FileStatus status) {
>   final String ugiStr = ugi.toString();
>   ...
> } {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org