Subject: chmod weirdness (was: Re: CVS commit: pkgsrc/lang/jasmin)
To: None <pkgsrc-changes@NetBSD.org>
From: Roland Illig <rillig@NetBSD.org>
List: pkgsrc-changes
Date: 12/01/2007 16:49:39
Joerg Sonnenberger wrote:
> On Sat, Dec 01, 2007 at 11:29:15AM +0000, Roland Illig wrote:
>> Log Message:
>> Joerg, could you please read the chmod(1) man page before making
>> directories inaccessible?
> 
> I did. This one is funny. On NetBSD I get an error (not found). On
> DragonFly It sets 555. I did try this before, not sure why it worked.

What did you intend with the mode "=urwXgrXorX"? When I interpret it 
correctly, it says:
- set all of the permission bits (the "who" field is empty)
- to those of the owner,
- then set "rwX",
- then set them to the same as the group,
- then to "rX",
- then to those of the others,
- then to "rX".

Since all these operations are overwriting ones, you end up with the 
same as "a=rX". I just tried to understand the setmode/getmode code: 
It's really complicated.

Roland