diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FsShellPermissions.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FsShellPermissions.java index 76e379c51f..1a8a777231 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FsShellPermissions.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FsShellPermissions.java @@ -112,7 +112,7 @@ protected void processPath(PathData item) throws IOException { // used by chown/chgrp static private String allowedChars = Shell.WINDOWS ? "[-_./@a-zA-Z0-9 ]" : - "[-_./@a-zA-Z0-9]"; + "[-+_./@a-zA-Z0-9]"; /** * Used to change owner and/or group of files diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSShell.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSShell.java index 65032514b4..d3920fca56 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSShell.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSShell.java @@ -1468,6 +1468,9 @@ public void testFilePermissions() throws IOException { runCmd(shell, "-chgrp", "hadoop-core@apache.org/100", file); confirmOwner(null, "hadoop-core@apache.org/100", fs, path); + + runCmd(shell, "-chown", "MYCOMPANY+user.name:hadoop", file); + confirmOwner("MYCOMPANY+user.name", "hadoop", fs, path); } /**