delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/07/11/15:22:42

X-Spam-Check-By: sourceware.org
Message-ID: <44B3FA6A.6060800@t-online.de>
Date: Tue, 11 Jul 2006 21:22:18 +0200
From: Christian Franke <Christian DOT Franke AT t-online DOT de>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060130 SeaMonkey/1.0
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: ":" in filename
References: <8389af8b0603241937m62e9701y596bed40382bd6f0 AT mail DOT gmail DOT com> <4424BE59 DOT 9184F1E1 AT dessent DOT net> <4424C1DC DOT 8010005 AT byu DOT net> <4425916C DOT 9040009 AT cygwin DOT com> <Pine DOT GSO DOT 4 DOT 63 DOT 0603261508220 DOT 4022 AT access1 DOT cims DOT nyu DOT edu>
In-Reply-To: <Pine.GSO.4.63.0603261508220.4022@access1.cims.nyu.edu>
X-ID: ESSHJyZ6weM8BGBD2Eeo1Wq4d+4+X-y5MofV9lpGNF9HTwyWkpWCs1
X-TOI-MSGID: 3e5e2c0b-9856-4da6-9678-a576e0c4d592
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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

Igor Peshansky wrote:
> On Sat, 25 Mar 2006, Larry Hall (Cygwin) wrote:
>   
>> Eric Blake wrote:
>>
>> <snip>
>>     
>>> It would be nice if cygwin could be more proactive in recognizing : as
>>> invalid in non-managed mounts, rather than passing the : on to the
>>> Windows filename functions, in order to avoid the creation of
>>> undeletable filenames such as ".new." via the help of a colon, but I
>>> can live with the current behavior if adding such a check would slow
>>> down the common case.
>>>       
>> The latter affect is certainly the case here though, as usual, I'm sure
>> it's a PTC if someone has a great brainstorm for a way to do this
>> without the overhead.
>>     
>
> Well, normalize_posix_path() (in path.cc) already scans the whole path
> string looking for '\\' -- I can't imagine that adding a check for ':'
> would introduce all that much overhead.  But, of course, empirical
> evidence is always best, and I don't have any at the moment.
>   

Two month ago, I tested an experimental enhancement to 1.5.19-4 which 
includes such a check.

It adds a new setting to the CYGWIN environment variable:
"ads:deny" - Return EINVAL on path names with ":" (as suggested)
"ads:allow" - Allow path names with ":" (the current behavior)
"ads:list" - Expose ADS is directory listings

Example:
$ touch test:one test:two

$ ls
test

$ CYGWIN=ads:list ls
test test:one test:two

I didn't realize any overhead for the first two settings.
The third setting of course slows down directory listings (~x4), but it 
allows things like cp/tar'ing files including ADS.

The (very preliminary) patch is here:
http://franke.dvrdns.org/cygwin/cygwin-1.5.19-4-ads.patch
Due to the substantial changes to fhandler_disk_file.cc, the patch is 
not compatible with current CVS.
But the small test for ":" in path.cc:normalize_posix_path() may still 
work ;-)

Christian


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