delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2019/09/21/11:43:36

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:from:to:subject:date:message-id:references
:in-reply-to:content-type:content-id:content-transfer-encoding
:mime-version; q=dns; s=default; b=uRh52CMdd0X+FqhcdG8hyJsy4CRx9
UKhnKgHrvqZFZnb9mYSNHl1QixHk+4L194v0R7JR6QWXgTSvX3U2LicfBWSmeD/w
NnxrZq90uAXyW+LT6I1uQSoKTRb1U9bQBmb9A8McYno+4ncOJ97LSWVRLVU188Km
Lbz4iO0ux57Fsk=
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:from:to:subject:date:message-id:references
:in-reply-to:content-type:content-id:content-transfer-encoding
:mime-version; s=default; bh=VAyiIYx7agc3nEvc/Va1TtxTIao=; b=i/p
K/ZbrUFN6XoiWwmmeqqfOCZKYJOE4xISPvj6vb81pGLzaWoF3oWIxbqovXKZp9Sc
jidQn6zV7boYLa6OxJaDW/GXdw2HvSVE32l+ExPNtWtLzIDnoBxeEQ2MXEusf8La
96HZKV+dt5F6rLlNlBVfz9uQQ+I0A22YO7ZjemhE=
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=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 spammy=enoent, ENOENT, cygwin-patches, cygwinpatches
X-HELO: NAM03-DM3-obe.outbound.protection.outlook.com
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bM+BWmnKAiM711dt2a4npC/2d5cw1yz7RZMzRFJcmH+hP2wU5u/+d7aDYKA/hEY/K8AB89oWThbkezhjmUXJsp1zB44IvyBe8eLEXVUQO9vg5JL6AfaKGiyaW8UODrBDpo5urHQ0ztQHSp12vpa60ePmxQ/HG/qooZ4fw6pSKbsPO6Dv7nzx28ly4v6rqs7cT2Jsagfx/kM/w6gM+tvvuCky7N1WB636AvyDcOPcCf1PBcoTwmscKzPWSE7G6L1gSocfkD35sBbGrVCb3ObL8V/xJ80EB7mOgTviETkLuFTRXYBX1kg61HoXYdGNS/qAcVtycMxFuO0W6ASUD2Ru4Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=598Xd2cJIJgSGuAkoHmhyeXqbQ19pPPLLS5UnKiJVAc=; b=Iy1/zSrGzqVMmtBcU1TuIPiibZbDjf4TnqUR87vIAztNSL6FF6xRYYcj1qc0X5lBIIwstCpffnAsRQ16QvYB8pfiKtFfX/BXgTuZrMfKwLGsXaCe9MG2Lt+Bwl+tqpl0JH/yiPW965BbqP2TUgT7E6NAyv0K4O3FZGpym/qgKn4FeDdcexk+Mb06trGk7EkKS3z82uX+Wm+qSNwpiEcFxvsDepVqy5pEyByFTKwf0itXmMsYgs4p5NnMbhUNkc/LlfBhHLgL7ymeKSQLxGy4S5E1OPKy8FGAfUVVurbzmU/TZGZb7E3Iax7eY+6Ya2UzXSWXIvLhP57lDlLkrenczA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cornell.edu; dmarc=pass action=none header.from=cornell.edu; dkim=pass header.d=cornell.edu; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cornell.edu; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=598Xd2cJIJgSGuAkoHmhyeXqbQ19pPPLLS5UnKiJVAc=; b=Uh2XWKlGzG0GRgsUjU4TfARLQhUQI7q5Lj8sxDt16zakhcylfyAq/mShoLEaybUNu1AFAF+U/Iv871iT3zXvSiVC7ftZBKnDeTqOZxEWHf0s/yQhIJuOZGqygmUhkNfX3ZrYiWOCGIyKYdRz2s9f/ey7oV6yxQL8Hv133dF9FfM=
From: Ken Brown <kbrown AT cornell DOT edu>
To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Subject: Re: Odd, is it not? mkdir 'e:\' cannot be undone by rmdir 'e:\' ...
Date: Sat, 21 Sep 2019 15:42:36 +0000
Message-ID: <8b163d0f-680f-e4ea-098c-703d0fac87fd@cornell.edu>
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> <4a87b7a940fb0cf76aac5f3bc5b1a8b3 AT smtp-cloud7 DOT xs4all DOT net> <e438666b60ee08a2a3ee4ca16015382f AT smtp-cloud9 DOT xs4all DOT net> <f77b318f-0c52-4b5f-3738-ff882804e84a AT cornell DOT edu> <e7cb47be199186f3c7438a0bfcc8c7df AT smtp-cloud7 DOT xs4all DOT net> <3eca1ecf200f0075efd154544c2fd5b4 AT smtp-cloud7 DOT xs4all DOT net>
In-Reply-To: <3eca1ecf200f0075efd154544c2fd5b4@smtp-cloud7.xs4all.net>
user-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0
authentication-results: spf=none (sender IP is ) smtp.mailfrom=kbrown AT cornell DOT edu;
x-ms-oob-tlc-oobclassifiers: OLM:4941;
received-spf: None (protection.outlook.com: cornell.edu does not designate permitted sender hosts)
x-ms-exchange-senderadcheck: 1
x-ms-exchange-transport-forked: True
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: EA51JEJu7HhhzH0e+seS897nhyz6lQrgqcPqThiv+ubHBG2DbDKi9DwUf5ST8QzwK1nuZtPBrBPPbZug0kDzqw==
X-IsSubscribed: yes
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id x8LFhH2l014766

On 9/20/2019 5:11 AM, Houder wrote:
> As I said already, the snippet should NOT be executed in general. Perhaps
> it is another left-over from old times that should have been deleted.

You're absolutely right.  Prior to commit b0717aae0, the code looked like this:

       if (strncmp (path, "\\\\.\\", 4))
	{
	  /* Windows ignores trailing dots and spaces in the last path
	     component, and ignores exactly one trailing dot in inner
	     path components. */
	  char *tail = NULL;
           [...]
	  if (!tail || tail == path)
	    /* nothing */;
	  else if (tail[-1] != '\\')
	    {
	      *tail = '\0';
	      strip_tail = true;
	    }
	  else
	    {
	      error = ENOENT;
	      return;
	    }
	}

Note the use of a *local* tail variable.  It's a pointer into path, as you can 
see by looking at the part I omitted.

In commit b0717aae0, Corinna intended to disable this code, but she 
inadvertently disabled only part of it.  Here's the relevant part of that commit:

@@ -1170,6 +1225,7 @@ out:
      {
        if (strncmp (path, "\\\\.\\", 4))
         {
+#if 0
           /* Windows ignores trailing dots and spaces in the last path
              component, and ignores exactly one trailing dot in inner
              path components. */
@@ -1190,7 +1246,7 @@ out:
                   tail = NULL;
                 }
             }
-
+#endif
           if (!tail || tail == path)
             /* nothing */;
           else if (tail[-1] != '\\')

In particular, the declaration of the local tail variable is in the disabled 
code, so the cruft at the end is referring to the other tail, which points into 
path_copy.

[A later commit removed the disabled code.]

I'll fix this and then look at your patches to mkdir and rmdir.  It would be 
very helpful if you would write these as a patch series with cover letter, using 
git format-patch, and send them to the cygwin-patches list.

Ken

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