Subject: Re: chmod(1) and '+X'
To: None <email@example.com>
From: Ben Harris <firstname.lastname@example.org>
Date: 01/17/2004 22:29:26
In article <email@example.com> you write:
>Jan Schaumann <firstname.lastname@example.org> writes:
>> "Perry E. Metzger" <email@example.com> wrote:
>>> So far as I know, our chmod ALREADY behaves correctly.
>> So the behaviour I reported in
>> http://mail-index.netbsd.org/tech-userlevel/2003/12/13/0008.html is
>> correct? It seems to me that 'chmod o-X' should remove the executable
>> bit from all directories or files that have it set. Instead, atm, it
>> _sets_ the executable bit, as if 'chmd o+X' had been issued.
>Didn't know about that. What I meant was that chmod o=rX works just
>fine -- + isn't the only thing that works right.
>Certainly adding the bit is wrong in the - case.
>However, what it *should* do is also unclear. What do other chmod's
>do? the -X thing seems ambiguous with respect to files at least.
As far as I can see POSIX is quite clear. X means the same thing whatever
the operation, so -X means "remove execute if the file is a directory or any
execute bit is currently set", which makes it equivalent to -x.
Ben Harris <bjh21@NetBSD.org>
Portmaster, NetBSD/acorn26 <URL:http://www.NetBSD.org/Ports/acorn26/>