[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: chmod octal form of sgid/suid removal fails
From: |
John Cowan |
Subject: |
Re: chmod octal form of sgid/suid removal fails |
Date: |
Mon, 14 May 2007 22:46:56 -0400 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
(Apologies to those, if any, who got an earlier version of this message.)
Paul Eggert scripsit:
> The counterargument is that it's strange if a leading
> zero changes the semantics of a number, as this is not what many
> people expect.
Fair enough. However, if the directory has mode 6755 and you
do "chmod 2755 dir", the mode remains 6755. This violates the
Law of Least Astonishment, I think.
I had earlier thought that it doesn't matter, because setuid
doesn't mean anything on directories in most *ix variants, but
on FreeBSD it causes files created in the directory to be
owned by the directory owner, analogously to setgid. See
http://www.greenend.org.uk/rjk/2004/perms.html for details.
> Please see the thread rooted here:
Thanks for the pointer.
> If you read that root, by the way, you'll see that existing practice
> is wildly different in this area. For example, on Solaris,
> "chmod 2755 DIR" silently ignores the "2".
Quite so. File modes are a mess, anyway. I suppose that on the whole
stability trumps "correctness".
--
As you read this, I don't want you to feel John Cowan
sorry for me, because, I believe everyone address@hidden
will die someday. http://www.ccil.org/~cowan
--From a Nigerian-type scam spam