Subject: | Need an option of creating directories with permissions more open than user's default mask |
I have frequently the need of creating files and directories having
permissions more open than the user's default.
As far as I know, Perl umask() can be used only to further restrict
user's permissions. The end result of the following code is different
when executed by different users (having different default mask):
umask(0000);
make_tree("/tmp/dir1/dir2/dir3", {mode => 0777});
This is causing several problems, since--in some cases-- the directories
created are not accessible to other users.
Since there is code relying on the existing behavior of 'mode', I would
suggest not to modify it (otherwise it would introduce security issues
in cases where one rely on this exact behavior).
I rather suggest creating the new modifier 'chmod' which will change the
directory permissions to the specified numeric value independently from
the mask, like the Perl function chmod() does.
E.g.
make_tree("/tmp/dir1/dir2/dir3", {chmod => 0777});
Thanks!
Paolo Amedeo