Subject: Re: chmod(1) and '+X'
To: None <>
From: Ben Harris <>
List: tech-userlevel
Date: 01/17/2004 22:29:26
In article <> you write:
>Jan Schaumann <> writes:
>> "Perry E. Metzger" <> wrote:
>>> So far as I know, our chmod ALREADY behaves correctly.
>> So the behaviour I reported in
>> 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                                                   <>
Portmaster, NetBSD/acorn26           <URL:>