FAQ
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}
[auser@machine test]$ mkdir foo
[auser@machine test]$ chmod 000 foo
[auser@machine test]$ ls -l foo
d--------- 2 auser users 4.0K Jan 10 02:09 foo
[auser@machine test]$ chmod u+rw,+x foo
[auser@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.

Search Discussions

  • Jakob Homan (JIRA) at Jan 13, 2009 at 11:07 pm
    [ 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}
    [auser@machine test]$ mkdir foo
    [auser@machine test]$ chmod 000 foo
    [auser@machine test]$ ls -l foo
    d--------- 2 auser users 4.0K Jan 10 02:09 foo
    [auser@machine test]$ chmod u+rw,+x foo
    [auser@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.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcommon-dev @
categorieshadoop
postedJan 13, '09 at 10:33p
activeJan 13, '09 at 11:07p
posts2
users1
websitehadoop.apache.org...
irc#hadoop

1 user in discussion

Jakob Homan (JIRA): 2 posts

People

Translate

site design / logo © 2022 Grokbase