delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/01/07/11:10:30

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Wed, 7 Jan 2009 17:09:25 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: [1.7] Cygwin 1.7 misnames hardlinks
Message-ID: <20090107160925.GE19133@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <4951B5EB DOT 5050705 AT i12 DOT com> <20090107142228 DOT GA19133 AT calimero DOT vinschen DOT de> <Pine DOT CYG DOT 4 DOT 58 DOT 0901070935440 DOT 3052 AT PC1163-8460-XP DOT flightsafety DOT com>
MIME-Version: 1.0
In-Reply-To: <Pine.CYG.4.58.0901070935440.3052@PC1163-8460-XP.flightsafety.com>
User-Agent: Mutt/1.5.17 (2007-11-01)
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 Jan  7 09:38, Brian Ford wrote:
> On Wed, 7 Jan 2009, Corinna Vinschen wrote:
> 
> > The same happens with all hardlinks to files used by the system.  The NT
> > status code returned when trying to set the delete disposition flag is
> > C0000121, STATUS_CANNOT_DELETE.  None of the Windows native methods to
> > delete these hardlinks works.  I'm still puzzeled how to get rid of
> > them. Does anybody knows how to do that?
> 
> Just a WAG, but disable Windows File Protection?
> 
> http://support.microsoft.com/kb/222193

No, I found the solution by getting the double-plus surprising result
that removing these hardlinks works in Cygwin 1.5.  For some reason only
the OS hackers at Microsoft might grok, setting the delete dispostion
flag for a file (*) doesn't work, but opening the file with the
FILE_FLAG_DELETE_ON_CLOSE flag and then closing it again (**) works
fine.  Go figure!  Unfortunately the DELETE_ON_CLOSE stuff is too
dangerous in some circumstances so it's not a generic solution.

I'm preparing a fix for 1.7.


Corinna

(*)  Which is also what the Win32 function DeleteFile does.
(**) Which is what Cygwin 1.5 and the native function ZwDeleteFile does.

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

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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