delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/07/23/05:15:14

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Mon, 23 Jul 2012 11:14:00 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Confusing, but not fatal bug....rmdir removed network dir (rename to .____00000hexnum/)
Message-ID: <20120723091400.GC12741@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <500B961D DOT 6050303 AT tlinx DOT org>
MIME-Version: 1.0
In-Reply-To: <500B961D.6050303@tlinx.org>
User-Agent: Mutt/1.5.21 (2010-09-15)
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 Jul 21 22:56, Linda Walsh wrote:
> I sometimes use "rmdir *" to clean up empty dir's.
> 
> This is not safe running under cygwin on Win7-64 when
> interacting with network-shares hosted on a samba
> server with unix extensions.
> 
> I do not know why and there was no permanent damage, but
> two of my directories -- both real directories (not symlinks or such)
> one, Documents/Desktop (it would have been pointed to by a windows symlink
> in my home dir),
> 
> AND
> a subdir under my Pictures dir -- that AFAIK, has no symlinks pointing
> at it, though the Pictures dir itself has multiple symlinks pointing
> to it (~/Pictures ~/Documents/Pictures).
> 
> Only those two dirs were affected
> (they were actually renamed to
> .___00000000c35e9519042054f270dcabaa/
> .___000000000005ec3bf67c17a3eb678016/
> 
> ---
> Both had open files in them as well but no files were
> missing (i.e. no signs of contents attempting to be
> removed like a rm -fr might have tried)...
> 
> Just the dir couldn't be removed (non-empty dirs are like
> that), so it apparently was renamed to some random name.
> 
> There doesn't appear to be any entries in my pending-moves
> operations, so I don't know what might have tried to trigger
> their removal...(?)...
> 
> Anyway, I was editing a file in one of the dirs and when I
> went to save, it couldn't... that's when I couldn't find
> the dir..so caught pretty fast, and ran 'find' and found
> my Desktop had also gotten deleted (not that I'd noticed,
> likely, until I rebooted, or tried to add/subtract an icon/file
> on my desktop).
> 
> (Yeah... my desktop is in a remote dir on the net, so when
> the net is down, I get a blank desktop where nothing can
> be saved...)...though having it in my doc folders on the net
> allows me have a common desktop content on multiple computers
> and accounts that share that doc dir.
> 
> After I restored it, (rename from ugly to correct name),
> I tried the same rmdir again -- did it again.

This behaviour is definitely not normal.

I just had another look into the source code, and on second thought,
there might be a chance that the test for a non-empty dir is skipped
and the dir is renamed instead.

The only problem is that:  Even though I see how I could potentially
enforce the situation, I fail to reproduce it.  Can you explicitely show
an ls of the dir and an strace of an rmdir which succeeded to rename the
dir?

I'll might send you a test DLL via PM at one point, if that's ok with
you.


Thanks,
Corinna

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