delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/06/23/22:41:07

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_PASS
X-Spam-Check-By: sourceware.org
From: Haojun Bao <baohaojun AT gmail DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: find(1) assertion for folder with a sub-folder named `x:'
References: <83k5381ra3 DOT fsf AT gmail DOT com> <20090619101927 DOT GV5039 AT calimero DOT vinschen DOT de> <5E25AF06EFB9EA4A87C19BC98F5C875303AF2A42 AT core-email DOT int DOT ascribe DOT com>
Date: Wed, 24 Jun 2009 10:40:44 +0800
In-Reply-To: <5E25AF06EFB9EA4A87C19BC98F5C875303AF2A42@core-email.int.ascribe.com> (Phil Betts's message of "Tue, 23 Jun 2009 17:39:06 +0100")
Message-ID: <83d48u5p77.fsf@gmail.com>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (cygwin)
MIME-Version: 1.0
X-IsSubscribed: yes
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

"Phil Betts" <Phil DOT Betts AT ascribe DOT com> writes:

> Corinna Vinschen wrote:
>> On Jun 19 17:55, Haojun Bao wrote:
>> > hi,
>> >
>> > Here's a test case to make find(1) assertion:
>> >
>> >     mkdir no-such-dir/foo/bar: -p
>> >
>> >     #this will not assert
>> >     find no-such-dir/
>> >
>> >     mkdir no-such-dir/foo/c: -p
>> 
>> I think the right answer here is "don't do that".  Don't create files
>> or directories starting with a single character, followed by a colon.
>> The problem is that a path starting with "X:" is treated as an
>> absolute Win32 path.
>> 
>> Right now you cannot have both.  Either a path starting with "X:" is
>> treated as Win32 path, or Cygwin must stop handling Win32 paths at all
>> and only allow POSIX paths.
>
> Just to underline what Corinna said, consider the consequences of 
> the following:

Corinna said, right now I can't have both, so maybe in the future:-). I
think Cygwin can stop handling Win32 paths since we already have
cygpath, so if one want to `rm -rf c:/',  one can simply write 
    rm -rf `cygpath -au c:/`
or simply
    rm -rf /cygdrive/c

Sometimes mixing Win32/Posix paths is good, sometimes it's bad. And
things are a bit different now in cygwin-1.7 since chars like
`:' in a filename are allowed.


>
> mkdir -p foo/c:
> cd foo
> rm -rf c:/
>
> In case you can't see why that's bad, DON'T TRY IT!!  Don't even copy 
> it, because you will accidentally paste it into a terminal window, you 
> will get to say "oopsy!" [1], and you will hurt your forehead on
> your keyboard.
>
> If you can't resist the temptation, do invite friends round to watch;
> you'll have a humorous shared memory for later in life.  Also consider
> videoing it, and getting a friend to post it on YouTube for you.

Haha, I'm from mainland China, and our goverment established GFW (Great
Fireuck-wall of WWW), also known as Golden Shield Project, and YouTube
has been blocked for several months. Pretty pathetic eh?


>
>
> [1] See http://www.theregister.co.uk/2008/10/03/bofh_2008_episode_32/
>
>
> Phil

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