[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Suggestion for mkdir

From: Pádraig Brady
Subject: Re: Suggestion for mkdir
Date: Thu, 21 Nov 2013 09:39:14 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2

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:

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/


p.s. there is a somewhat related discussion
re perms of parent dirs and umask at:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]