delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2019/08/30/05:55:39

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:message-id:from:reply-to:to:cc:subject
:references:in-reply-to:content-type; q=dns; s=default; b=Tccqu1
hSyYWK0z4k77bv4VsJHNOH68fhbIUylhpLJoX9W3+wtlf0oUK4bRIxBRaK3LY54g
/BCI5lD8C0GXmLKNZ5zjkw8Jw+MzCFdnP/T+bISEMI4xy/Xx2JbBHecuy+6yYZHZ
JSEfg9unag+dt1dmZjsc6aRtwLbmaOlUTBQUQ=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:message-id:from:reply-to:to:cc:subject
:references:in-reply-to:content-type; s=default; bh=kTxJKnkxI6YS
FkfV9t9nCXgEUFE=; b=PW39Fr81CakEGWLvNl5abOoOeVEWnplEDMLWh6QPB41G
cBwuamQOK0eqh0le1tm0ll/ZuMnyk83U4S+a7SE5x25QniFSY8raMyx1U1rQPX6I
ADIkBDGojW7i7wuhcCqbs54crhVpMPPcf2BgghtRMHz2IkmiTHibpBq31tMpSho=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.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
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=-4.4 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,NORMAL_HTTP_TO_IP,NUMERIC_HTTP_ADDR,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.1 spammy=snip
X-HELO: lb1-smtp-cloud7.xs4all.net
Date: Fri, 30 Aug 2019 11:54:27 +0200
Message-ID: <4a87b7a940fb0cf76aac5f3bc5b1a8b3@smtp-cloud7.xs4all.net>
From: Houder <houder AT xs4all DOT nl>
Reply-To: cygwin AT cygwin DOT com
To: cygwin AT cygwin DOT com
Cc: eblake AT redhat DOT com
Subject: Re: Odd, is it not? mkdir 'e:\' cannot be undone by rmdir 'e:\' ...
References: <bc3df101ab93c20b86c3ab7fa7d3ea4f AT xs4all DOT nl> <20190827152549 DOT GY11632 AT calimero DOT vinschen DOT de> <a47cc167b725c08e6f1c914166fabcaf AT smtp-cloud8 DOT xs4all DOT net> <3E262D05-F393-453A-9E43-B248DDE50812 AT solidrocksystems DOT com> <b97e4dbe952154efc68412540514ae81 AT smtp-cloud8 DOT xs4all DOT net> <20190828125939 DOT GL11632 AT calimero DOT vinschen DOT de> <421ac447-b249-da21-1ca5-228041cfc884 AT redhat DOT com> <20190828141556 DOT GM11632 AT calimero DOT vinschen DOT de> <20190828142220 DOT GN11632 AT calimero DOT vinschen DOT de> <ee1138b29ee4be60d62d86d59f581b2e AT smtp-cloud8 DOT xs4all DOT net>
In-Reply-to: <ee1138b29ee4be60d62d86d59f581b2e@smtp-cloud8.xs4all.net>
User-Agent: mua.awk 0.99

On Thu, 29 Aug 2019 17:05:41, Houder  wrote:
> On Wed, 28 Aug 2019 16:22:20, Corinna Vinschen  wrote:
[snip]

> > One problem here is, what to do about border cases like
> > 
> >   $ mkdir a\/\/\/
> > 
> > In theory slashes and backslashes should both be treated as dir
> > separators.  Handling a case like this so that all expectations
> > are satisfied is next to impossible, I guess.
> 
> How about dropping Eric's code snippet in winsup/cygwin/dir.cc ?????
> 
> Subdirectory 'a' is created. No problem there. Perhaps the patch has
> become superfluous/ redundant over time?
> 
> I have tried different "values" for the path-argument to mkdir, and
> have not found a problem while the code snippet is being skipped.
> 
> What am I missing?

A trailing forward slash in "pathname" is stripped in path_conv::check,

(look for: *--tail = '\0' )

after "pathname" has been normalized in

normalized_posix_path or normalized_win32_path (or both),

before it is fed into conv_to_win32_path.

Tests have shown that Eric's code snippet can be deleted w/o harm.

Counter arguments?

Henri

> -----
> Breakpoint 1 at 0x1800548b9: file /usr/src/debug/cygwin-3.1.0-0.2/winsup/cygwin/dir.cc, line 317.
> Breakpoint 2 at 0x1800548e3: file /usr/src/debug/cygwin-3.1.0-0.2/winsup/cygwin/dir.cc, line 326.
> (gdb) r
> Starting program: /usr/bin/mkdir 'a\/\/\/'
> [New Thread 1064.0x1a8c]
> [New Thread 1064.0x59c]
> 
> Thread 1 "mkdir" hit Breakpoint 1, mkdir (dir=0x800041320 "a\\/\\/\\/", mode=511)
>     at /usr/src/debug/cygwin-3.1.0-0.2/winsup/cygwin/dir.cc:317
> 317           if (isdirsep (dir[strlen (dir) - 1]))
> (gdb) j dir.cc:326
> Continuing at 0x1800548e3.
> 
> Thread 1 "mkdir" hit Breakpoint 2, mkdir (dir=0x800041320 "a\\/\\/\\/", mode=511)
>     at /usr/src/debug/cygwin-3.1.0-0.2/winsup/cygwin/dir.cc:326
> 326           if (!(fh = build_fh_name (dir, PC_SYM_NOFOLLOW)))
> (gdb) c
> Continuing.
> [Inferior 1 (process 1064) exited normally]
> (gdb) quit
> 
> 64-@@ ls -ld a*
> drwxr-xr-x+ 1 Henri None 0 Aug 29 16:47 a
> 
> =====


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