Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-16750

NameNode should use NameNode.getRemoteUser() to log audit event to avoid possible NPE

    XMLWordPrintableJSON

Details

    • Reviewed

    Description

      NameNode should use NameNode.getRemoteUser() to log audit event to avoid possible NPE.

      The relate code is: 

      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();
        ...
      } 

      Attachments

        Issue Links

          Activity

            People

              xuzq_zander ZanderXu
              xuzq_zander ZanderXu
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: