HDFS-9286. HttpFs does not parse ACL syntax correctly for operation REMOVEACLENTRIES. Contributed by Wei-Chiu Chuang.

This commit is contained in:
cnauroth 2015-10-22 15:25:10 -07:00
parent 513ec3de19
commit 124a412a37
5 changed files with 11 additions and 5 deletions

View File

@ -1025,7 +1025,7 @@ public static class FSRemoveAclEntries implements FileSystemAccess.FileSystemExe
*/
public FSRemoveAclEntries(String path, String aclSpec) {
this.path = new Path(path);
this.aclEntries = AclEntry.parseAclSpec(aclSpec, true);
this.aclEntries = AclEntry.parseAclSpec(aclSpec, false);
}
/**

View File

@ -738,6 +738,7 @@ private void testFileAcls() throws Exception {
}
final String aclUser1 = "user:foo:rw-";
final String rmAclUser1 = "user:foo:";
final String aclUser2 = "user:bar:r--";
final String aclGroup1 = "group::r--";
final String aclSet = "user::rwx," + aclUser1 + ","
@ -765,7 +766,7 @@ private void testFileAcls() throws Exception {
httpfsAclStat = httpfs.getAclStatus(path);
assertSameAcls(httpfsAclStat, proxyAclStat);
httpfs.removeAclEntries(path, AclEntry.parseAclSpec(aclUser1, true));
httpfs.removeAclEntries(path, AclEntry.parseAclSpec(rmAclUser1, false));
proxyAclStat = proxyFs.getAclStatus(path);
httpfsAclStat = httpfs.getAclStatus(path);
assertSameAcls(httpfsAclStat, proxyAclStat);

View File

@ -501,12 +501,13 @@ public static String setXAttrParam(String name, byte[] value) throws IOException
@TestHdfs
public void testFileAcls() throws Exception {
final String aclUser1 = "user:foo:rw-";
final String remAclUser1 = "user:foo:";
final String aclUser2 = "user:bar:r--";
final String aclGroup1 = "group::r--";
final String aclSpec = "aclspec=user::rwx," + aclUser1 + ","
+ aclGroup1 + ",other::---";
final String modAclSpec = "aclspec=" + aclUser2;
final String remAclSpec = "aclspec=" + aclUser1;
final String remAclSpec = "aclspec=" + remAclUser1;
final String dir = "/aclFileTest";
final String path = dir + "/test";
String statusJson;

View File

@ -243,12 +243,13 @@ private void putCmd(String filename, String command,
@TestJetty
public void testWithNoAcls() throws Exception {
final String aclUser1 = "user:foo:rw-";
final String rmAclUser1 = "user:foo:";
final String aclUser2 = "user:bar:r--";
final String aclGroup1 = "group::r--";
final String aclSpec = "aclspec=user::rwx," + aclUser1 + ","
+ aclGroup1 + ",other::---";
final String modAclSpec = "aclspec=" + aclUser2;
final String remAclSpec = "aclspec=" + aclUser1;
final String remAclSpec = "aclspec=" + rmAclUser1;
final String defUser1 = "default:user:glarch:r-x";
final String defSpec1 = "aclspec=" + defUser1;
final String dir = "/noACLs";
@ -278,4 +279,4 @@ public void testWithNoAcls() throws Exception {
miniDfs.shutdown();
}
}
}

View File

@ -2114,6 +2114,9 @@ Release 2.8.0 - UNRELEASED
HDFS-9273. ACLs on root directory may be lost after NN restart.
(Xiao Chen via cnauroth)
HDFS-9286. HttpFs does not parse ACL syntax correctly for operation
REMOVEACLENTRIES. (Wei-Chiu Chuang via cnauroth)
Release 2.7.2 - UNRELEASED
INCOMPATIBLE CHANGES