Skip to content

Commit c8ed33c

Browse files
committed
HADOOP-9851. dfs -chown does not like "+" plus sign in user name. Contributed by Andras Bokor.
1 parent fc4ebb0 commit c8ed33c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FsShellPermissions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ protected void processPath(PathData item) throws IOException {
112112

113113
// used by chown/chgrp
114114
static private String allowedChars = Shell.WINDOWS ? "[-_./@a-zA-Z0-9 ]" :
115-
"[-_./@a-zA-Z0-9]";
115+
"[-+_./@a-zA-Z0-9]";
116116

117117
/**
118118
* Used to change owner and/or group of files

hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSShell.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1468,6 +1468,9 @@ public void testFilePermissions() throws IOException {
14681468

14691469
runCmd(shell, "-chgrp", "hadoop-core@apache.org/100", file);
14701470
confirmOwner(null, "hadoop-core@apache.org/100", fs, path);
1471+
1472+
runCmd(shell, "-chown", "MYCOMPANY+user.name:hadoop", file);
1473+
confirmOwner("MYCOMPANY+user.name", "hadoop", fs, path);
14711474
}
14721475

14731476
/**

0 commit comments

Comments
 (0)