delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/09/10/05:17:01

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Fri, 10 Sep 2010 11:16:32 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Oddities with file deletion on CIFS drive
Message-ID: <20100910091632.GB16534@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <FF9587650EB15D3C59CFAA56@[192.168.1.2]>
MIME-Version: 1.0
In-Reply-To: <FF9587650EB15D3C59CFAA56@[192.168.1.2]>
User-Agent: Mutt/1.5.20 (2009-06-14)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019