[ 
https://issues.apache.org/jira/browse/HADOOP-5024?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jakob Homan resolved HADOOP-5024.
---------------------------------

    Resolution: Invalid

> DFS chmod does not correctly parse some multiple-mode permission 
> specifications
> -------------------------------------------------------------------------------
>
>                 Key: HADOOP-5024
>                 URL: https://issues.apache.org/jira/browse/HADOOP-5024
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: dfs
>            Reporter: Jakob Homan
>
> The current implementation of chmod attempts to combine multiple permission 
> specifications into one omnibus specification that represents the end result 
> of all the specifications.  However, this fails for some specifications, 
> essentially allowing the latest specified mode to override the prior ones.  
> For example the following chmod in unix results in:
> {noformat}
>      [au...@machine test]$ mkdir foo   
>      [au...@machine test]$ chmod 000 foo
>      [au...@machine test]$ ls -l foo 
>      d---------  2 auser users 4.0K Jan 10 02:09 foo
>      [au...@machine test]$ chmod u+rw,+x foo
>      [au...@machine test]$ ls -l foo
>      drwx--x--x  2 auser users 4.0K Jan 10 02:09 foo
> {noformat}
> while the current implementation results in: (adapted from TestDFSShell.java)
> {noformat}
>      runCmd(shell, "-chmod", "000", file.toString());
>      assertEquals("---------", 
> fs.getFileStatus(file).getPermission().toString());
>      
>      runCmd(shell, "-chmod", "u+rw,+x", file.toString());
>      assertEquals("drwx--x--x", 
> fs.getFileStatus(file).getPermission().toString());
>      // fails, with the actual result of
>      // result = --x--x--x
> {noformat}
> Unix appears to apply each specified mode sequentially, and this approach 
> would correct the problem in DFSShell as well at the cost of a separate rpc 
> call for each mode specification.  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to