delorie.com/archives/browse.cgi | search |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sources.redhat.com/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs> |
Sender: | cygwin-owner AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
Delivered-To: | mailing list cygwin AT cygwin DOT com |
X-Authentication-Warning: | beth.swift.xxx: swift set sender to swift AT alum DOT mit DOT edu using -f |
To: | cygwin AT cygwin DOT com |
Subject: | chmod: unexpected results when uid = gid for a file |
From: | Matt Swift <swift AT alum DOT mit DOT edu> |
Date: | Sat, 21 Sep 2002 22:44:19 -0400 |
Message-ID: | <m2admaoi9o.fsf@swift.shore.net> |
Lines: | 125 |
User-Agent: | Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 |
(i386-debian-linux-gnu) | |
MIME-Version: | 1.0 |
I have observed the following reproducible strange behavior of chmod. You will notice that several of the commands do something different than they would do on a Unix system (I've marked these commands with "!!!" in the right margin). I think chmod is doing the wrong thing in those cases, but possibly someone can explain why it is the desired and documented thing. My conjecture consistent with tests so far is that problems occur only when a file's owner is the same as the file's group. When I was trying to figure this out, I came across another question: what is the "mask" that one can read/set with getfacl and setfacl? I do not understand it and it does not seem to be documented anywhere. [vav] test> umask 0000 [vav] test> alias d='ls -lAn' [vav] test> [vav] test> d total 0 -rw-rw-rw- 1 500 544 0 Sep 21 19:11 a -rw-rw-rw- 1 500 544 0 Sep 21 19:11 b -rw-rw-rw- 1 500 544 0 Sep 21 19:11 c -rw-rw-rw- 1 500 544 0 Sep 21 19:11 d [vav] test> chmod o-w *; d total 0 -rw-rw-r-- 1 500 544 0 Sep 21 19:11 a -rw-rw-r-- 1 500 544 0 Sep 21 19:11 b -rw-rw-r-- 1 500 544 0 Sep 21 19:11 c -rw-rw-r-- 1 500 544 0 Sep 21 19:11 d [vav] test> chmod g-w *; d total 0 -rw-r--r-- 1 500 544 0 Sep 21 19:11 a -rw-r--r-- 1 500 544 0 Sep 21 19:11 b -rw-r--r-- 1 500 544 0 Sep 21 19:11 c -rw-r--r-- 1 500 544 0 Sep 21 19:11 d [vav] test> chmod go+w *; d total 0 -rw-rw-rw- 1 500 544 0 Sep 21 19:11 a -rw-rw-rw- 1 500 544 0 Sep 21 19:11 b -rw-rw-rw- 1 500 544 0 Sep 21 19:11 c -rw-rw-rw- 1 500 544 0 Sep 21 19:11 d [vav] test> chown 544 * [vav] test> d total 0 -rw-rw-rw- 1 544 544 0 Sep 21 19:11 a -rw-rw-rw- 1 544 544 0 Sep 21 19:11 b -rw-rw-rw- 1 544 544 0 Sep 21 19:11 c -rw-rw-rw- 1 544 544 0 Sep 21 19:11 d [vav] test> chmod o-w *; d !!! total 0 -rw-r--r-- 1 544 544 0 Sep 21 19:11 a -rw-r--r-- 1 544 544 0 Sep 21 19:11 b -rw-r--r-- 1 544 544 0 Sep 21 19:11 c -rw-r--r-- 1 544 544 0 Sep 21 19:11 d [vav] test> chmod g+w *; d !!! total 0 -rw-r--r-- 1 544 544 0 Sep 21 19:11 a -rw-r--r-- 1 544 544 0 Sep 21 19:11 b -rw-r--r-- 1 544 544 0 Sep 21 19:11 c -rw-r--r-- 1 544 544 0 Sep 21 19:11 d [vav] test> chown 500 a b [vav] test> d total 0 -rw-r--r-- 1 500 544 0 Sep 21 19:11 a -rw-r--r-- 1 500 544 0 Sep 21 19:11 b -rw-r--r-- 1 544 544 0 Sep 21 19:11 c -rw-r--r-- 1 544 544 0 Sep 21 19:11 d [vav] test> chmod g+w *; d !!! total 0 -rw-rw-r-- 1 500 544 0 Sep 21 19:11 a -rw-rw-r-- 1 500 544 0 Sep 21 19:11 b -rw-r--r-- 1 544 544 0 Sep 21 19:11 c -rw-r--r-- 1 544 544 0 Sep 21 19:11 d [vav] test> chmod go+w *; d total 0 -rw-rw-rw- 1 500 544 0 Sep 21 19:11 a -rw-rw-rw- 1 500 544 0 Sep 21 19:11 b -rw-rw-rw- 1 544 544 0 Sep 21 19:11 c -rw-rw-rw- 1 544 544 0 Sep 21 19:11 d [vav] test> chmod a-w *; d total 0 -r--r--r-- 1 500 544 0 Sep 21 19:11 a -r--r--r-- 1 500 544 0 Sep 21 19:11 b -r--r--r-- 1 544 544 0 Sep 21 19:11 c -r--r--r-- 1 544 544 0 Sep 21 19:11 d [vav] test> chmod u+w *; d total 0 -rw-r--r-- 1 500 544 0 Sep 21 19:11 a -rw-r--r-- 1 500 544 0 Sep 21 19:11 b -rw-r--r-- 1 544 544 0 Sep 21 19:11 c -rw-r--r-- 1 544 544 0 Sep 21 19:11 d [vav] test> chmod o+w *; d !!! total 0 -rw-r--rw- 1 500 544 0 Sep 21 19:11 a -rw-r--rw- 1 500 544 0 Sep 21 19:11 b -r--rw-rw- 1 544 544 0 Sep 21 19:11 c -r--rw-rw- 1 544 544 0 Sep 21 19:11 d [vav] test> [vav] test> chmod --version chmod (fileutils) 4.1 Written by David MacKenzie. Copyright (C) 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. [vav] test> bash --version GNU bash, version 2.05b.0(5)-release (i686-pc-cygwin) Copyright (C) 2002 Free Software Foundation, Inc. [vav] test> uname -a CYGWIN_NT-5.1 VAV 1.3.12(0.54/3/2) 2002-07-06 02:16 i686 unknown [vav] test> echo $CYGWIN binmode ntsec tty ntea -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |