Web lists-archives.com

Re: [ANNOUNCEMENT] TEST: Cygwin 3.0.0-0.3




On Feb  6 17:20, Corinna Vinschen wrote:
> On Feb  6 15:28, Michael Haubenwallner wrote:
> > On 2/3/19 12:19 PM, Corinna Vinschen wrote:
> > > On Jan 31 20:48, Corinna Vinschen wrote:
> > >> On Jan 31 09:47, Michael Haubenwallner wrote:
> > >>> Hi Corinna,
> > >>>
> > >>> I'm missing that topic/forkables branch in the announcement - is that in?
> > >>> https://cygwin.com/ml/cygwin-patches/2017-q1/msg00053.html
> > >>
> > >> No, it's not.  It hasn't been touched for almost two years so I forgot
> > >> about it.
> > >>
> > >> Does it still apply to current mainline?  Will it still work correctly
> > >> in conjunction with the Windows 10 1709/1803/1809 changes in terms of
> > >> deleting and renaming files?
> > 
> > Independent of topic/forkables: With Cygwin 3.0.0 replacing/removing an
> > exe or dll in use does fail on Server 2019 while it does succeed on 2012.
> > The error messages on Server 2019 is 'Permission denied'.
> 
> Is that the new FILE_DISPOSITION_POSIX_SEMANTICS change by any chance?
> 
> https://sourceware.org/git/?p=newlib-cygwin.git;a=commitdiff;h=a7f392686b5b2
> 
> If so, sigh, no new API without drawbacks.
> 
> I guess we have to fallback to the old method in certain cases.

Can you try this patch, please?

diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index 62b9638447ab..a1fd6cc9c975 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -733,7 +733,11 @@ unlink_nt (path_conv &pc)
       if (pc.file_attributes () & FILE_ATTRIBUTE_READONLY)
 	NtSetAttributesFile (fh, pc.file_attributes ());
       NtClose (fh);
-      goto out;
+      /* Trying to delete in-use executables and DLLs using
+         FILE_DISPOSITION_POSIX_SEMANTICS returns STATUS_CANNOT_DELETE.
+	 Fall back to the old method. */
+      if (status != STATUS_CANNOT_DELETE)
+	goto out;
     }
 
   /* If the R/O attribute is set, we have to open the file with


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer

Attachment: signature.asc
Description: PGP signature