delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2019/09/20/03:56:54

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:subject
:references:in-reply-to:content-type; q=dns; s=default; b=ReZcWs
X15tv3XPUT82tQ1SiG7Umy6UGfm7t6Mr4dMAIPwVfAvp/2D+0ktBGlgPlGoQc84u
zlfBZS3dmp44tOfiJG1zmm4MuQRC6WJ1mz9mE+7o1dhNnIdiM7lRa0STs6nM6wi7
4w3a6945hRfw4VmaCvmbt1f0uiGiT6141gkRE=
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:subject
:references:in-reply-to:content-type; s=default; bh=q7poIDK74y2g
2V98oDPRs62V4oA=; b=d6PTdWAgkb136jmlcnECcqDTMSIB5fUmHqyWC4ss/Iro
erIQPJOSAIh5PEPZ1E6CURK5rtYvKGaqXfxiX7a0juH3aExZufvrmgCKmF3h3YjN
3nW6XO0aXZCN7CVuAS0kFNq8D9WqKonQ35kPbzumvihExzY71n98aC0/6A7XER4=
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=-5.1 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.1 spammy=H*M:smtp, H*F:D*nl, ic, HX-Languages-Length:2024
X-HELO: lb1-smtp-cloud7.xs4all.net
Date: Fri, 20 Sep 2019 09:55:59 +0200
Message-ID: <e7cb47be199186f3c7438a0bfcc8c7df@smtp-cloud7.xs4all.net>
From: Houder <houder AT xs4all DOT nl>
Reply-To: cygwin AT cygwin DOT com
To: cygwin AT cygwin 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> <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>
In-Reply-to: <f77b318f-0c52-4b5f-3738-ff882804e84a@cornell.edu>
User-Agent: mua.awk 0.99

On Thu, 19 Sep 2019 18:04:47, Ken Brown  wrote:
> On 9/1/2019 1:38 PM, Houder wrote:
> > On Fri, 30 Aug 2019 11:54:27, Houder  wrote:
> 
> [...]
> 
> > As the directory "/foo" had been correctly created, I turned to
> > path_conv::check(), which is called when build_fhname() creates
> > the path_conv object (also called pc) -- see dtable.cc.
> >
> > Examining this (obsure) method in path.cc, I corrected the code
> > in 2 places:
> >
> > ---
> >        if (dev.isfs ())
> >          {
> >            //if (strncmp (path, "\\\\.\\", 4)) <==== 1171
> >            if ( ! strncmp (path, "\\\\.\\", 4)) // <==== [1]
> >              {
> >                if (!tail || tail == path)
> >                  /* nothing */;
> >                else if (tail[-1] != '\\')
> >                  *tail = '\0'; <==== Ah! (you should not do that!)
> >                else
> >                  {
> >                    error = ENOENT;
> >                    return;
> >                  }
> >              }
> >
> > [1] this code should be executed only if path == '\\.\' !!

Sorry Ken, for not being correct ... Of course, the statement above tests
whether or not the string *** starts with *** \\.\

> I don't agree with your analysis here.

Analysis of what? No Ken, I did not _analyze_ what this piece of code is
good for.

I only discovered that it "mutilates" the code if one exexutes

    mkdir /foo, where foo is a nonexisting directory

So, in general this piece of code should NOT be executed. And I doubt if
it is ever reached in case of a device path, like \\.\e: (did not check).

Btw, do not pay attention to the second correction (hack) that I made in
this method; I dropped it.

That said, my modifications to mkdir_2 and rmdir_2 are more relevant.

Currently, rmdir_2 is not in agreement with Posix (and Linux).

Currently I am running the modified code (including the above correction
in "path resolution" -- i.c. path_conv::check).

Found no problems. And my tests show that rmdir_2 is now in agreement w/
Posix (and Linux).

Oh sorry, mkdir_2 and rmdir_2 should be read as mkdir(2) and rmdir(2).

(the syscalls in dir.cc, not the functions in fhandler_disk_file.cc)

Henri


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