浏览代码

HDFS-6823. dfs.web.authentication.kerberos.principal shows up in logs for insecure HDFS

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1616845 13f79535-47bb-0310-9956-ffa450edef68
Ravi Prakash 11 年之前
父节点
当前提交
6da830cfdf
共有 1 个文件被更改,包括 5 次插入3 次删除
  1. 5 3
      hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSUtil.java

+ 5 - 3
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSUtil.java

@@ -1668,9 +1668,11 @@ public class DFSUtil {
         .setKeytabConfKey(getSpnegoKeytabKey(conf, spnegoKeytabFileKey));
         .setKeytabConfKey(getSpnegoKeytabKey(conf, spnegoKeytabFileKey));
 
 
     // initialize the webserver for uploading/downloading files.
     // initialize the webserver for uploading/downloading files.
-    LOG.info("Starting web server as: "
-        + SecurityUtil.getServerPrincipal(conf.get(spnegoUserNameKey),
-            httpAddr.getHostName()));
+    if (UserGroupInformation.isSecurityEnabled()) {
+      LOG.info("Starting web server as: "
+          + SecurityUtil.getServerPrincipal(conf.get(spnegoUserNameKey),
+              httpAddr.getHostName()));
+    }
 
 
     if (policy.isHttpEnabled()) {
     if (policy.isHttpEnabled()) {
       if (httpAddr.getPort() == 0) {
       if (httpAddr.getPort() == 0) {