On 11/20/2013 09:51 PM, Renich Bon Ciric wrote:
> Hello,
> 
> I'd like to suggest that:
> 
> mkdir -m 2771 -p /tmp/some/nonexistent/dir
> 
> sets 2751 to all created dirs; not just the last one.
> 
> Thank you and congratulations for the great work on coreutils!

This was previously discussed at:
http://bugs.gnu.org/14249

So the control you have on the parent dir perms is a bit restricted
(pardon the pun), and you can just clear bits (except for u=wx) with umask.

Wanting to setgid the whole hierarchy is valid, but mkdir
couldn't do that without races anyway.
You wouldn't really gain anything apart from convenience over doing:

 mkdir -p /tmp/some
 chmod g+s /tmp/some
 mkdir -p /tmp/some/nonexistent/dir

The OS should without races propagate the setgid bit to
new dirs below /tmp/some/

thanks,
Pádraig.

p.s. there is a somewhat related discussion
re perms of parent dirs and umask at:
http://savannah.gnu.org/bugs/?19546

Reply via email to