This is the mail archive of the cygwin 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]

Re: Oddities with file deletion on CIFS drive


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.
> 
> build@zre-win-002 /cygdrive/z/current/WINDOWS/main/20100908131458_ZDESKTOP/ZimbraBuild/templates
> $ rm -f *

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

> build@zre-win-002 /cygdrive/z/current/WINDOWS/main/20100908131458_ZDESKTOP/ZimbraBuild/templates
> $ 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.

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


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

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


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