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: permission denied when removing files on remote file share that is offline


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


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