1.5.16-1: chmod problem

Eric Blake ebb9@byu.net
Thu May 5 13:08:00 GMT 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Pach Roman (GS-EC/ESA4) * on 5/3/2005 10:53 PM:
> I admit I'm stubborn about this topic but I'd like to propose 
> the change of chmod implementation.
> I thing, it would be nice if the 'chmod +/-w' would have in the discussed case the same
> functionality as the Windows' command 'attrib'.

It isn't going to happen at the coreutils level on chmod(1).  POSIX
requires that `chmod -- -w file' be valid (-w is treated as the mode
argument, not an option), and that it remove only those write permissions
which would be granted by creat() given the current umask, making it
behave differently than `chmod a-w file' which removes all write
permissions.  But there was a discussion on the bug-coreutils list just
this week (see
http://comments.gmane.org/gmane.comp.gnu.coreutils.bugs/4171, since
lists.gnu.org is still down following the FSF office move) how POSIX
allows `chmod -w file' or `chmod -w -- file' as an extension (here, -w is
an option, and POSIX only specifies the -R option), and in CVS, it was
just changed so that `chmod -w file' will do what `chmod -- -w file' is
required to do, but print a warning if that action is different than what
`chmod a-w file' would do.  So, even though we could define whatever
behavior we wanted for the -w option to chmod, I am not going to define it
differently for cygwin that what upstream has defined it to be, based on
what POSIX defines.

That's not to say that Corinna's changes to chmod(2) might affect your
situation, so do give the latest cygwin snapshot a try.  And meanwhile, if
Windows attrib has the semantics you want, then use Windows attrib.

- --
Life is short - so eat dessert first!

Eric Blake             ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCehqM84KuGfSFAYARAtXmAKC/36Pxs4ttcNkqEzy0s4UmZdEX9QCfY9dC
4I3CovmDn11kiB99fQ9rITw=
=HDIy
-----END PGP SIGNATURE-----

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list