This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

chmod -w . allows deleting files?


Hi,
This is probably a windows problem, but here goes:
I'm observing a weird behavior in chmod.  Basically, it looks like
removing the write permission for everyone on a directory doesn't prevent
the owner from deleting the files in that directory (which is inconsistent
with other unixes).  What's really weird is that the Windows permissions
on the directory actually look correct (i.e., disallow deletions;
screenshot attached).  The file's permissions allow deletion, though.
Below is a session log.  Can anyone make sense of this?
Oh, `uname -a`="CYGWIN_NT-5.0 PECHTCHA 1.3.12(0.54/3/2) 2002-07-06 02:16
i686 unknown", OS is Win2k SP2, Cygwin version is 1.3.12-4.
	Igor

[pechtcha:/tmp/chmodtest] ls -la
total 20
drwx--x--x    2 igor     None            0 Sep 24 10:13 ./
drwxrwxrwx    9 igor     None        20480 Sep 24 10:13 ../
[pechtcha:/tmp/chmodtest] chmod a-w .
[pechtcha:/tmp/chmodtest] touch rpm
touch: creating `rpm': Permission denied
[pechtcha:/tmp/chmodtest] chmod u+w .
[pechtcha:/tmp/chmodtest] touch rpm
[pechtcha:/tmp/chmodtest] chmod u-w .
[pechtcha:/tmp/chmodtest] ls -la
total 20
dr-x--x--x    2 igor     None            0 Sep 24 10:13 ./
drwxrwxrwx    9 igor     None        20480 Sep 24 10:13 ../
-rwx--x--x    1 igor     None            0 Sep 24 10:13 rpm*
[pechtcha:/tmp/chmodtest] mv rpm rpm-old
mv: cannot create regular file `rpm-old': Permission denied
[pechtcha:/tmp/chmodtest] touch rpm-old
touch: creating `rpm-old': Permission denied
[pechtcha:/tmp/chmodtest] rm -f rpm
[pechtcha:/tmp/chmodtest] echo $?
0
[pechtcha:/tmp/chmodtest] ls -la
total 20
dr-x--x--x    2 igor     None            0 Sep 24 10:13 ./
drwxrwxrwx    9 igor     None        20480 Sep 24 10:13 ../
[pechtcha:/tmp/chmodtest] getfacl .
# file: .
# owner: igor
# group: None
user::r-x
group::--x
mask::--x
other::--x
default:user::r-x
default:group::--x
default:mask::--x
default:other::--x
[pechtcha:/tmp/chmodtest] cacls .
C:\cygwin\tmp\chmodtest PECHTCHA\igor:(OI)(CI)(special access:)
                                              READ_CONTROL
                                              WRITE_DAC
                                              WRITE_OWNER
                                              SYNCHRONIZE
                                              FILE_GENERIC_READ
                                              FILE_GENERIC_EXECUTE
                                              FILE_READ_DATA
                                              FILE_READ_EA
                                              FILE_WRITE_EA
                                              FILE_EXECUTE
                                              FILE_READ_ATTRIBUTES
                                              FILE_WRITE_ATTRIBUTES

                        PECHTCHA\None:(OI)(CI)(special access:)
                                              READ_CONTROL
                                              SYNCHRONIZE
                                              FILE_GENERIC_EXECUTE
                                              FILE_READ_EA
                                              FILE_EXECUTE
                                              FILE_READ_ATTRIBUTES

                        Everyone:(OI)(CI)(special access:)
                                         READ_CONTROL
                                         SYNCHRONIZE
                                         FILE_GENERIC_EXECUTE
                                         FILE_READ_EA
                                         FILE_EXECUTE
                                         FILE_READ_ATTRIBUTES

[pechtcha:/tmp/chmodtest]

-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Water molecules expand as they grow warmer" (C) Popular Science, Oct'02, p.51

Attachment: dir_perm.png
Description: Binary data

Attachment: rpm_perm.png
Description: Binary data

--
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/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]