[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: "chmod -w file" now complains if file is still writable afterwards
From: |
Paul Eggert |
Subject: |
Re: "chmod -w file" now complains if file is still writable afterwards |
Date: |
Wed, 04 May 2005 22:09:29 -0700 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (gnu/linux) |
address@hidden (Eric Blake) writes:
> Other questions, though - with our extension options, should we interpret
> `chmod -w a+x foo' the same as `chmod -- -w ./a+x ./foo' or like
> `chmod -- -w,a+x ./foo'?
It's been the former for a while; I guess that's OK.
> POSIX allows modes that look like long options - can the code be
> made to treat `chmod --w foo' the same as it would `chmod -w foo' by
> seeing if unrecognized long options match a valid mode string?
Not in general, because plain "--" is a valid mode option, but POSIX
specifies a different meaning for "--". I don't think it's worth
worrying much about other leading-"--" forms, as nobody is likely to
use them (unlike "-w", say).
> Speaking of which, the `chmod --help' wording could be improved (perhaps
> with examples); it does not mention -w, -r, etc. as being extension options,
I doubt whether this level of detail needs to be in the usage; usage
is just meant to be a brief reminder, not a formal spec.
> and wrongly states that "one or more of the letters ugoa" is required as who,
> and "one or more of the letters rwxXstugo" is required as perm/permcopy.
Good point. That's fixed in CVS. It now says:
Each MODE is of the form `[ugoa]*([-+=]([rwxXst]*|[ugo]))+'.