You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Steve Loughran (JIRA)" <ji...@apache.org> on 2018/06/25 19:40:00 UTC

[jira] [Commented] (HADOOP-13612) FileSystem static mkdirs(FS, path, permissions) to invoke FS.mkdirs(path, permissions)

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

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

returning to this, on a prune of my old git branches. 

Maybe: leave alone but tag as @deprecated and explain why in the javadocs?

> 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
>            Assignee: Steve Loughran
>            Priority: Major
>         Attachments: HADOOP-13612-branch-2-001.patch
>
>
> 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
(v7.6.3#76005)

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