From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14054 invoked by alias); 7 Jan 2009 23:37:26 -0000 Received: (qmail 14046 invoked by uid 22791); 7 Jan 2009 23:37:26 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_63 X-Spam-Check-By: sourceware.org Received: from fed1rmmtao106.cox.net (HELO fed1rmmtao106.cox.net) (68.230.241.40) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 07 Jan 2009 23:37:21 +0000 Received: from fed1rmimpo02.cox.net ([70.169.32.72]) by fed1rmmtao106.cox.net (InterMail vM.7.08.02.01 201-2186-121-102-20070209) with ESMTP id <20090107233720.MHCA12540.fed1rmmtao106.cox.net@fed1rmimpo02.cox.net> for ; Wed, 7 Jan 2009 18:37:20 -0500 Received: from [192.168.1.102] ([68.107.41.113]) by fed1rmimpo02.cox.net with bizsmtp id 0ndK1b00C2SVYAk04ndKlH; Wed, 07 Jan 2009 18:37:19 -0500 X-Authority-Analysis: v=1.0 c=1 a=6w2RKkhu7vgA:10 a=yMhMjlubAAAA:8 a=eMESK3aN-QKgfw9VgFQA:9 a=DO-jKUiTqLimAxg5LP4hq_QsgC0A:4 a=WcGY3-TIXCwA:10 X-CM-Score: 0.00 Message-ID: <49653CBB.10804@i12.com> Date: Thu, 08 Jan 2009 00:30:00 -0000 From: Lawrence Mayer Reply-To: cygwin@cygwin.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1b3pre) Gecko/20081204 Thunderbird/3.0b1 MIME-Version: 1.0 To: cygwin@cygwin.com Subject: Re: [1.7] Cygwin 1.7 misnames hardlinks References: <4951B5EB.5050705@i12.com> <20090107142228.GA19133@calimero.vinschen.de> <20090107160925.GE19133@calimero.vinschen.de> In-Reply-To: <20090107160925.GE19133@calimero.vinschen.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2009-01/txt/msg00169.txt.bz2 >> 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? > On Jan 7 09:38, Brian Ford wrote: >> Just a WAG, but disable Windows File Protection? >> >> http://support.microsoft.com/kb/222193 On 090107 08:09, Corinna Vinschen wrote: > 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. Thanks for fixing the original hardlink minsnaming problem Corinna. A Windows native way to remove in-use hardlinks is to overwrite them with DOS Move, e.g. C:\>ln Windows\fonts\vgaoem.fon . C:\>del vgaoem.fon C:\vgaoem.fon Access is denied. C:\>echo dummy file> foo C:\>move /y foo vgaoem.fon >nul C:\>del vgaoem.fon A restriction is that the two files foo and vgaoem.fon must reside on the same filesystem (Volume). New Year Greetings, Lawrence -- 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/