--On Friday, September 10, 2010 11:16 AM +0200 Corinna Vinschen <> wrote:

On Sep  8 15:17, Quanah Gibson-Mount wrote:
I have a CIFS drive I connect to as the windows user.  I can write
to the drive with no problem.  However, when I go to delete files
from the drive, Cygwin behaves very oddly.

bu...@zre-win-002
/cygdrive/z/current/WINDOWS/main/20100908131458_ZDESKTOP/ZimbraBuild/tem
plates $ rm -f *

If you call rm w/o the -f flag, what error message do you get?
Just a simple "Permission denied", I guess.

Nope.  It doesn't give any error.

bu...@zre-win-002 /cygdrive/z/current/WINDOWS/main/20100908131458_ZDESKTOP/ZimbraBuild/templates
$ rm BUILD_ISYNC_template
rm: remove write-protected regular file `BUILD_ISYNC_template'? y

bu...@zre-win-002 /cygdrive/z/current/WINDOWS/main/20100908131458_ZDESKTOP/ZimbraBuild/templates
$ ls -l BUILD_ISYNC_template
-r-xr-xr-x 1 ???????? ???????? 1453 2010-09-08 13:31 BUILD_ISYNC_template

bu...@zre-win-002
/cygdrive/z/current/WINDOWS/main/20100908131458_ZDESKTOP/ZimbraBuild/tem
plates $ ls -l
total 104
-r-xr-xr-x 1 ???????? ???????? 1362 2010-09-08 13:31 BUILD_EVO_template
-r-xr-xr-x 1 ???????? ???????? 1453 2010-09-08 13:31 BUILD_ISYNC_template
[...]
Now, if I modify the file to be +w, then -w, so it returns to its
original permissions, I can suddenly delete it:

Did you create the files with a Cygwin aplication or with a native Win32
application?  In theory, there's nothing mysterious here, if the
permissions of the file are so that the DELETE permission for your user
or group is missing in the file's ACL.  For obvious reasons the POSIX
permission bits can't reflect the complexity of the original NT ACL.
The chmod +w/-w somehow overwrite the original permissions with POSIX
permissions as Cygwin generates them and the result is more DELETE
friendly.  Did you try to compare the ACL before and after the chmod?
The output of `cacls filename' is probably different.

The files are created with a native Win32 application (Perforce), where it is checking these files out of the Perforce repository.

Here is the output from cacls prior to +w/-w:
bu...@zre-win-002 /cygdrive/z/current/WINDOWS/main/20100908131458_ZDESKTOP/ZimbraBuild/templates
$ cacls BUILD_ISYNC_template
Z:\current\WINDOWS\main\20100908131458_ZDESKTOP\ZimbraBuild\templates\BUILD_ISYNC_template
Everyone:F
<Account Domain not found>F
<Account Domain not found>R
Everyone:R


Here is cacls after +w/-w:
Z:\current\WINDOWS\main\20100908131458_ZDESKTOP\ZimbraBuild\templates\BUILD_ISYNC_template <Account Domain not found>(special access:)

STANDARD_RIGHTS_ALL

DELETE

READ_CONTROL

WRITE_DAC

WRITE_OWNER

SYNCHRONIZE

STANDARD_RIGHTS_REQUIRED

FILE_GENERIC_READ

FILE_GENERIC_EXECUTE

FILE_READ_DATA

FILE_READ_EA

FILE_EXECUTE

FILE_READ_ATTRIBUTES

FILE_WRITE_ATTRIBUTES


<Account Domain not found>R

Everyone:R


This behavior is quite bizarre.  I should be able to delete the
files I created with the "-f" option to "rm".

Well, in theory, yes.  However, it's possible that your CIFS drive
has semantics which disallow this with the original ACL for some
reason.  Can you pleae run `strace -o rm.trace rm some_file' on a
file which has the original ACL (before the chmod call) and send the
rm.trace file?

Done.  I've provided strace output from both rm <FILE> and rm -f <FILE>

Let me know if there is anything else I can provide.

--Quanah

--

Quanah Gibson-Mount
Principal Software Engineer
Zimbra, Inc
--------------------
Zimbra ::  the leader in open source messaging and collaboration

Attachment: rm.trace.gz
Description: Binary data

Attachment: rmf.trace.gz
Description: Binary data

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

Reply via email to