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:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type; q=dns; s=default; b=ubgn bp7s4n9zkPFR8T1M2Ab2RweVkzME3ssRjSH0wJ9JYtSju+BdiY5AzuBi1nC2rmGj aXxs8pSpNvVgAcImNMGKvh4poGzUn6LjP1uF92xqA9vBsEeBplqbYEQWPfwJV7h5 23kWR02LgIZA41O+ef89C4BHHFuOhPDKLrg3rds= 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:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type; s=default; bh=hIAvl4mFQy Dp3HRZai1yxEMOeR0=; b=jnG2OGW5oR/gvGKCauO44G5jBlJvGxk2uIATi4nMjg R/v2mefWBnTbzNGTbzibk5Brzk1VGFBYYj8bNMc84BTUvzMNKXwxt7qTmA8sNAni 5uF530UZoA8lDk1fjsipJCLhbWAeDoxEf/OvxbESxt1bNPdD3cCCFWelawVsVvcS E= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , 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=-2.1 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx1.redhat.com Subject: Re: Odd, is it not? mkdir 'e:\' cannot be undone by rmdir 'e:\' ... To: cygwin AT cygwin DOT com References: <20190827152549 DOT GY11632 AT calimero DOT vinschen DOT de> <3E262D05-F393-453A-9E43-B248DDE50812 AT solidrocksystems DOT com> <20190828125939 DOT GL11632 AT calimero DOT vinschen DOT de> From: Eric Blake Openpgp: preference=signencrypt Message-ID: <421ac447-b249-da21-1ca5-228041cfc884@redhat.com> Date: Wed, 28 Aug 2019 08:36:41 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190828125939.GL11632@calimero.vinschen.de> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="JNqU72IbvBM8GcnG5C5WFeHsDUswI5mV6" X-IsSubscribed: yes --JNqU72IbvBM8GcnG5C5WFeHsDUswI5mV6 Content-Type: multipart/mixed; boundary="V2q6vqQW4tAbrjGUQ6PzPJNT4uMfWkpAX"; protected-headers="v1" From: Eric Blake To: cygwin AT cygwin DOT com Message-ID: <421ac447-b249-da21-1ca5-228041cfc884 AT redhat DOT com> Subject: Re: Odd, is it not? mkdir 'e:\' cannot be undone by rmdir 'e:\' ... References: <20190827152549 DOT GY11632 AT calimero DOT vinschen DOT de> <3E262D05-F393-453A-9E43-B248DDE50812 AT solidrocksystems DOT com> <20190828125939 DOT GL11632 AT calimero DOT vinschen DOT de> In-Reply-To: <20190828125939 DOT GL11632 AT calimero DOT vinschen DOT de> --V2q6vqQW4tAbrjGUQ6PzPJNT4uMfWkpAX Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 8/28/19 7:59 AM, Corinna Vinschen wrote: >>>>> mkdir(2) has some special code from 2009 which drops trailing >>>>> {back}slashes to perform a bordercase in mkdir Linux-compatible. >>>>> This code snippet doesn't exist in rmdir(2). Dropping trailing slashes to be Linux-compatible is okay. Dropping trailing backslashes is risky, though, if it makes us forget that the user was asking for a DOS path (even though DOS paths are not always going to work as expected). >=20 > Eric, any insight? As usual our comments from way back when are lacking > in terms of what exact problem this code is trying to fix/workaround. If I recall, we had cases where 'mkdir a/' and 'mkdir a' did not behave identically, even though POSIX says they should; compounded by the fact that Windows treats trailing slash differently when performing native mkdir on a drive than it does on a subdirectory of a drive. It may be as simple as changing the isdirsep() from the identified commit to instead check only for '/' (and ignore '\'). >=20 > Given this case, I wonder if we really need this code or if we can't > just drop it. Of course, it would be great to learn what bordercase > this code was trying to handle and if there isn't another way to do that. >=20 >=20 > Corinna >=20 --=20 Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org --V2q6vqQW4tAbrjGUQ6PzPJNT4uMfWkpAX-- --JNqU72IbvBM8GcnG5C5WFeHsDUswI5mV6 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEccLMIrHEYCkn0vOqp6FrSiUnQ2oFAl1mg2kACgkQp6FrSiUn Q2relQgAqHIASHcD0vE0YYfQYdfXSmlZVXaLgIVRP/+LnrSG6SRqU0m2qjQRBk74 pYy698zpbcjjATqOq4CdFHitxltGUx3Wi7ZCWTuiSQ9LtQ2ve6BWPJebYK5KHiK/ pHMiTkYvce3qrTF8kpn7+6dgS7wZzD9v1nCWM1vBF9eeB51A9hkPE4yj3c6XnUii /0BVU15hmv2OTKv5+HrnHHFi/2b+7g7bDi5SVgT4b9v4fB8YXEqhz6Ku0UPb6Gp+ cd7fXvWMV/uM+1KNukmQIlh7eGJ/FtaS4ch6QmxMoRYOqnV0bbBAAf4K8lfSGvFS 0stTafC+2Wzj3DWI/tRoJ9MOMjx7eA== =PQfp -----END PGP SIGNATURE----- --JNqU72IbvBM8GcnG5C5WFeHsDUswI5mV6--