HADOOP-10507. Merging change r1609503 from trunk to branch-2.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1609506 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
52a07f1a39
commit
41406e3702
|
@ -15,6 +15,9 @@ Release 2.6.0 - UNRELEASED
|
||||||
HADOOP-10781. Unportable getgrouplist() usage breaks FreeBSD (Dmitry
|
HADOOP-10781. Unportable getgrouplist() usage breaks FreeBSD (Dmitry
|
||||||
Sivachenko via Colin Patrick McCabe)
|
Sivachenko via Colin Patrick McCabe)
|
||||||
|
|
||||||
|
HADOOP-10507. FsShell setfacl can throw ArrayIndexOutOfBoundsException when
|
||||||
|
no perm is specified. (Stephen Chu and Sathish Gurram via cnauroth)
|
||||||
|
|
||||||
Release 2.5.0 - UNRELEASED
|
Release 2.5.0 - UNRELEASED
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
|
|
@ -278,7 +278,7 @@ public class AclEntry {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (includePermission) {
|
if (includePermission) {
|
||||||
if (split.length < index) {
|
if (split.length <= index) {
|
||||||
throw new HadoopIllegalArgumentException("Invalid <aclSpec> : "
|
throw new HadoopIllegalArgumentException("Invalid <aclSpec> : "
|
||||||
+ aclStr);
|
+ aclStr);
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,6 +83,19 @@ public class TestAclCommands {
|
||||||
"", "/path" }));
|
"", "/path" }));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testSetfaclValidationsWithoutPermissions() throws Exception {
|
||||||
|
List<AclEntry> parsedList = new ArrayList<AclEntry>();
|
||||||
|
try {
|
||||||
|
parsedList = AclEntry.parseAclSpec("user:user1:", true);
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
}
|
||||||
|
assertTrue(parsedList.size() == 0);
|
||||||
|
assertFalse("setfacl should fail with less arguments",
|
||||||
|
0 == runCommand(new String[] { "-setfacl", "-m", "user:user1:",
|
||||||
|
"/path" }));
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMultipleAclSpecParsing() throws Exception {
|
public void testMultipleAclSpecParsing() throws Exception {
|
||||||
List<AclEntry> parsedList = AclEntry.parseAclSpec(
|
List<AclEntry> parsedList = AclEntry.parseAclSpec(
|
||||||
|
|
Loading…
Reference in New Issue