Jelajahi Sumber

HDFS-13505. Turn on HDFS ACLs by default. Contributed by Siyao Meng.

Ayush Saxena 5 tahun lalu
induk
melakukan
e9b6b81de4

+ 1 - 1
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSConfigKeys.java

@@ -299,7 +299,7 @@ public class DFSConfigKeys extends CommonConfigurationKeys {
       HdfsClientConfigKeys.DeprecatedKeys.DFS_PERMISSIONS_SUPERUSERGROUP_KEY;
   public static final String  DFS_PERMISSIONS_SUPERUSERGROUP_DEFAULT = "supergroup";
   public static final String  DFS_NAMENODE_ACLS_ENABLED_KEY = "dfs.namenode.acls.enabled";
-  public static final boolean DFS_NAMENODE_ACLS_ENABLED_DEFAULT = false;
+  public static final boolean DFS_NAMENODE_ACLS_ENABLED_DEFAULT = true;
   public static final String DFS_NAMENODE_POSIX_ACL_INHERITANCE_ENABLED_KEY =
       "dfs.namenode.posix.acl.inheritance.enabled";
   public static final boolean

+ 2 - 2
hadoop-hdfs-project/hadoop-hdfs/src/main/resources/hdfs-default.xml

@@ -510,10 +510,10 @@
 
 <property>
   <name>dfs.namenode.acls.enabled</name>
-  <value>false</value>
+  <value>true</value>
   <description>
     Set to true to enable support for HDFS ACLs (Access Control Lists).  By
-    default, ACLs are disabled.  When ACLs are disabled, the NameNode rejects
+    default, ACLs are enabled.  When ACLs are disabled, the NameNode rejects
     all RPCs related to setting or getting ACLs.
   </description>
 </property>

+ 1 - 1
hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/HdfsPermissionsGuide.md

@@ -319,7 +319,7 @@ Configuration Parameters
 *   `dfs.namenode.acls.enabled = true`
 
     Set to true to enable support for HDFS ACLs (Access Control Lists). By
-    default, ACLs are disabled. When ACLs are disabled, the NameNode rejects
+    default, ACLs are enabled. When ACLs are disabled, the NameNode rejects
     all attempts to set an ACL.
 
 *   `dfs.namenode.posix.acl.inheritance.enabled`

+ 1 - 4
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestAclConfigFlag.java

@@ -160,10 +160,7 @@ public class TestAclConfigFlag {
   private void initCluster(boolean format, boolean aclsEnabled)
       throws Exception {
     Configuration conf = new Configuration();
-    // not explicitly setting to false, should be false by default
-    if (aclsEnabled) {
-      conf.setBoolean(DFSConfigKeys.DFS_NAMENODE_ACLS_ENABLED_KEY, true);
-    }
+    conf.setBoolean(DFSConfigKeys.DFS_NAMENODE_ACLS_ENABLED_KEY, aclsEnabled);
     cluster = new MiniDFSCluster.Builder(conf).numDataNodes(1).format(format)
       .build();
     cluster.waitActive();