delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/09/07/05:08:59

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Tue, 7 Sep 2010 11:08:27 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: permission denied when removing files on remote file share that is offline
Message-ID: <20100907090827.GM16534@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <5FA595E1BD1AE146A2069381870C99F2FBFC14CC AT icexm6 DOT ic DOT ac DOT uk>
MIME-Version: 1.0
In-Reply-To: <5FA595E1BD1AE146A2069381870C99F2FBFC14CC@icexm6.ic.ac.uk>
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  6 18:34, Thielemans, Kris wrote:
> On Sep  6 15:33, Thielemans, Kris wrote:
> > I'm using a file share with Offline Folders such that I can access
> > it when not connected to our intranet. In cygwin I cannot remove any
> > files that I create on the share when it's offline: 
> > 
> >   $  touch /xxx/testfile
> >   $ rm /xxx/testfile
> >   rm: cannot remove `/xxx/testfile': Permission denied
> > 
> 
> Strange.  I cannot reproduce this problem.
> [...]
> Can you run rm under strace?  Maybe there's a status code which gives
> some helpful information.  Look for the "unlink_nt" function.
> 
> -------------------
> 
> I did the following
> 
> $ strace rm /h/TEMP/testfile > /h/TEMP/rm.log
> rm: cannot remove `/h/TEMP/testfile': Permission denied
> 
> The few lines around unlink_nt are as follows (full log file attached):
> 
>    87  230535 [main] rm 5200 path_conv::check: this->path(H:\TEMP\testfile), has_acls(0)
>  1107  231642 [main] rm 5200 unlink_nt: Setting delete disposition failed, status = 0xC0000022
>   117  231759 [main] rm 5200 seterrno_from_nt_status: /ext/build/netrel/src/cygwin-1.7.7-1/winsup/cygwin/syscalls.cc:714 status 0xC0000022 -> windows error 5
>    94  231853 [main] rm 5200 geterrno_from_win_error: windows error 5 == errno 13
>    77  231930 [main] rm 5200 unlink: -1 = unlink (/h/TEMP/testfile)
> 
> Does this help?

Not really.  In the default case, the unlink_nt function just opens the
file for deletion and then sets the delete disposition for the file.
That's pretty much all what happens.  The above snippet shows that the
OS function to set the delete disposition fails with status 0xc0000022,
which is STATUS_ACCESS_DENIED.  I had hoped for some other status code,
but, no luck here.  There's no hint why this occurs.  I examined what
happens in my case using sysinternal's process monitor.  Windows
Explorer uses the same way to delete the file(*) as Cygwin does.  Maybe
process monitor helps to figure out what happens on your machine but I
doubt it.  I'm out of ideas, sorry.


Corinna

(*) In case you wonder.  This is Windows.  There are three ways to
    delete a file, not just one.

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