HADOOP-9851. dfs -chown does not like "+" plus sign in user name. Contributed by Andras Bokor.

This commit is contained in:
Ayush Saxena 2020-06-17 13:55:40 +05:30
parent fc4ebb0499
commit c8ed33cd2a
2 changed files with 4 additions and 1 deletions

View File

@ -112,7 +112,7 @@ protected void processPath(PathData item) throws IOException {
// used by chown/chgrp // used by chown/chgrp
static private String allowedChars = Shell.WINDOWS ? "[-_./@a-zA-Z0-9 ]" : 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 * Used to change owner and/or group of files

View File

@ -1468,6 +1468,9 @@ public void testFilePermissions() throws IOException {
runCmd(shell, "-chgrp", "hadoop-core@apache.org/100", file); runCmd(shell, "-chgrp", "hadoop-core@apache.org/100", file);
confirmOwner(null, "hadoop-core@apache.org/100", fs, path); confirmOwner(null, "hadoop-core@apache.org/100", fs, path);
runCmd(shell, "-chown", "MYCOMPANY+user.name:hadoop", file);
confirmOwner("MYCOMPANY+user.name", "hadoop", fs, path);
} }
/** /**