hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Colin Patrick McCabe (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-3903) DFSClient mkdirs applies default umask to the specified permission
Date Fri, 07 Sep 2012 20:12:07 GMT

    [ https://issues.apache.org/jira/browse/HDFS-3903?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13450932#comment-13450932

Colin Patrick McCabe commented on HDFS-3903:

The default umask is supposed to be applied to the given permission.

This corresponds to how {{mkdir(2)}} and {{creat(2)}} work in UNIX.

$ man 2 mkdir

       mkdir - create a directory

       #include <sys/stat.h>
       #include <sys/types.h>

       int mkdir(const char *pathname, mode_t mode);

The  argument mode specifies the permissions to use.  It is modified by the process's umask
the usual way: the permissions of the created directory are (mode &  ~umask  &  0777).
mode bits of the created directory depend on the operating system.  For Linux, see below.

Similarly, HDFS has modified the given permission by the umask, all the way back to HADOOP-1298,
which introduced permissions.  We should make sure we're doing this in WebHDFS as well...
> DFSClient mkdirs applies default umask to the specified permission
> ------------------------------------------------------------------
>                 Key: HDFS-3903
>                 URL: https://issues.apache.org/jira/browse/HDFS-3903
>             Project: Hadoop HDFS
>          Issue Type: Bug
>    Affects Versions: 2.0.0-alpha
>            Reporter: Eli Collins
>            Assignee: Eli Collins
>            Priority: Critical
> Per Romain on HDFS-3491: This is still broken. Octal is correctly accepted but not applied
when during a MKDIR:
> {noformat}
> romain@runreal:~/projects/hue$ curl -X PUT "http://localhost:14000/webhdfs/v1/tmp/test-perm-httpfs?permission=01777&op=MKDIRS&user.name=hue&doas=hue"
> {"boolean":true}
> romain@runreal:~/projects/hue$ curl "http://localhost:14000/webhdfs/v1/tmp/test-perm-httpfs?op=GETFILESTATUS&user.name=hue&doas=hue"
> {"FileStatus":{"pathSuffix":"","type":"DIRECTORY","length":0,"owner":"hue","group":"supergroup","permission":"755","accessTime":0,"modificationTime":1345658456869,"blockSize":0,"replication":0}}
> {noformat}

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

View raw message