[ https://issues.apache.org/jira/browse/HDFS-10376?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
John Zhuge updated HDFS-10376: ------------------------------ Attachment: HDFS-10376.002.patch Patch 002: * Add 2 more unit tests to cover what [~yzhangal] described * The current {{setOwner}} implementation throws FNFE in the new tests because it checks the existence of the last inode in path first. However, it is also reasonable to throw ACE. {code:title=FSDirectory#checkOwner} if (iip.getLastINode() == null) { throw new FileNotFoundException( "Directory/File does not exist " + iip.getPath()); } checkPermission(pc, iip, true, null, null, null, null); {code} > Enhance setOwner testing > ------------------------ > > Key: HDFS-10376 > URL: https://issues.apache.org/jira/browse/HDFS-10376 > Project: Hadoop HDFS > Issue Type: Bug > Affects Versions: 2.6.0 > Reporter: Yongjun Zhang > Assignee: John Zhuge > Attachments: HDFS-10376.001.patch, HDFS-10376.002.patch > > > TestPermission create a user with the following name and group: > {code} > final private static String USER_NAME = "user" + RAN.nextInt(); > final private static String[] GROUP_NAMES = {"group1", "group2"}; > UserGroupInformation userGroupInfo = > UserGroupInformation.createUserForTesting(USER_NAME, GROUP_NAMES ); > > FileSystem userfs = DFSTestUtil.getFileSystemAs(userGroupInfo, conf); > // make sure mkdir of a existing directory that is not owned by > // this user does not throw an exception. > userfs.mkdirs(CHILD_DIR1); > > {code} > Supposedly > {code} > userfs.setOwner(CHILD_FILE3, "foo", "bar"); > {code} > will be run as the specified user, but it seems to be run as me who run the > test. > Running as the specified user would disallow setOwner, which requires > superuser privilege. This is not happening. > Creating this jira for some investigation to understand whether it's indeed > an issue. > Thanks. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org