hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Loughran (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-13612) FileSystem static mkdirs(FS, path, permissions) to invoke FS.mkdirs(path, permissions)
Date Wed, 14 Sep 2016 14:09:20 GMT

    [ https://issues.apache.org/jira/browse/HADOOP-13612?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15490526#comment-15490526
] 

Steve Loughran commented on HADOOP-13612:
-----------------------------------------

HADOOP-1873 added permissions to the static mkdirs operation into Hadoop 0.16; it came shortly
after the actual addition of the mkdirs(path, permission) call (HADOOP-2288). There's no obvious
reason recorded in the discussion as to why the sequence of mkdirs/set perms is called. Maybe
they just hadn't noticed the method

> FileSystem static mkdirs(FS, path, permissions) to invoke FS.mkdirs(path, permissions)
> --------------------------------------------------------------------------------------
>
>                 Key: HADOOP-13612
>                 URL: https://issues.apache.org/jira/browse/HADOOP-13612
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: fs
>    Affects Versions: 2.7.3
>            Reporter: Steve Loughran
>
> Currently {{FileSystem}}'s static {{mkdirs(FileSystem fs, Path dir, FsPermission permission)}}
creates the directory in a two step operation
> {code}
>     // create the directory using the default permission
>     boolean result = fs.mkdirs(dir);
>     // set its permission to be the supplied one
>     fs.setPermission(dir, permission);
> {code}
> this isn't atomic and creates a risk of race/security conditions. *This code is used
in production*
> Better to simply forward to mkdirs(path, permissions).
> is there any reason to not do that?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


Mime
View raw message