X-Recipient: archive-cygwin@delorie.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:reply-to:subject:to:references:from:message-id
	:date:mime-version:in-reply-to:content-type
	:content-transfer-encoding; q=dns; s=default; b=ebbmectkc9uQqgfC
	TrKiO5fpaCIPCRAdnout0z5UI/N9ihfvtJxDNSRMiXJX8fM0jwY0b6fXvqXB0F09
	Oy4/a0f9OA3ItZ7ejQeqyUGDnIwsWiICZXq4+U+Q7ASpcyBlCZtXSrSgZ+4fQ3di
	n8DgSVGCw/Yc7hu8A4UozoXSDcE=
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:reply-to:subject:to:references:from:message-id
	:date:mime-version:in-reply-to:content-type
	:content-transfer-encoding; s=default; bh=LutsCTCx1lUb59lTP9cPJr
	MvEh8=; b=A5IOyj7ejU82+oGrWw6y54LI6etNbvQgieB51zJMtu7by1l2k+eiQF
	vfxcWgfKH5itmOGTIftPKlAm5u7fXaR2axoQrQfXX+ty0eoGCVMD76xSKp0wvUyp
	ilBRKDHuimGXg6TvwSCpcl0lbLoh0aI+L5KG8QyaVIhxtC5c24fFI=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=calgary, Calgary, Alberta, OSI
X-HELO: smtp-out-so.shaw.ca
X-Authority-Analysis: v=2.3 cv=OeS28CbY c=1 sm=1 tr=0 a=MVEHjbUiAHxQW0jfcDq5EA==:117 a=MVEHjbUiAHxQW0jfcDq5EA==:17 a=IkcTkHD0fZMA:10 a=uZvujYp8AAAA:8 a=EmhFjOt0ynRgF5Fj0JYA:9 a=hq1Tr9e3fb5mhN_d:21 a=ANNTBFCTJE82pgm2:21 a=QEXdDO2ut3YA:10 a=wmmLBvuHnAUA:10 a=SLzB8X_8jTLwj6mN0q5r:22
Reply-To: Brian.Inglis@SystematicSw.ab.ca
Subject: Re: [bug] coreutils: potentially dangerous: $(realpath //) != /
To: cygwin@cygwin.com
References: <20180312232815.692b5da79fc18abf86d42ba1@inbox.ru> <20180313023854.2e07e4396f934961935e4435@inbox.ru> <0277f5b4-35e4-4da0-2bea-b73c4fdcfa89@redhat.com> <20180314135845.caeb571cdd5a54fc5b3fd4aa@inbox.ru>
From: Brian Inglis <Brian.Inglis@SystematicSw.ab.ca>
Message-ID: <9c7017ac-7e88-1dcd-8cf3-eb6f99714e63@SystematicSw.ab.ca>
Date: Wed, 14 Mar 2018 23:40:54 -0600
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0
MIME-Version: 1.0
In-Reply-To: <20180314135845.caeb571cdd5a54fc5b3fd4aa@inbox.ru>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-CMAE-Envelope: MS4wfGFnI5Kx9LIJWTeWFHk1hCwyiF/68qYYoqlDlLnbpvuM2kmzEitgwdtWvUzQb00wdz+aQ3hSQ5LUV1DltVYhgAqQqYTMvlphK/zh0nKkJ/DTcRHuGJ8J tbYmR/Rdmk1QWuQTm7dktR7YqbiExzKtGVUQtHT5Zr0Yy6mvSEvbJo2h8jaY5ZYij0u/7Wq3PG2oTA==
X-IsSubscribed: yes

On 2018-03-14 04:58, Mikhail Usenko via cygwin wrote:
> On Mon, 12 Mar 2018 20:43:13 -0500
> Eric Blake <...> wrote:
> I don't know what this is for, but nevertheless,
> thank you for your efforts to eliminate of illiteracy among readers...

>> POSIX allows leeway between implementations; this is one of those 
>> documented places where they differ, yet are still both POSIX compliant 
>> with their different choices.  If your script is not robust to what 
>> POSIX has already warned you about, fix your script.
>>
>>> and, as a consequence, I should avoid the case where
>>> somewhere in a bash script evaluating of some variable would lead to one of
>>> the following command to execute:
>>> rm -rf /*
>>> rm -rf //*
>>> rm -rf ///*
>>> rm -rf ////*
>>> that all do the very same thing in Linux.
>>
>> 3 of the 4 do the same thing on ALL POSIX platforms.  The only one that 
>> has implementation-defined behavior is 'rm -rf //*', which is different 
>> on systems where // is distinct (such as Cygwin).  All the other 
>> spellings (attempt) to remove all non-hidden files from the root directory.
>>
> If you really claims that Cygwin may and should be different and distinct from all other
> existing POSIX systems (the more so that it is allowed by POSIX),
> then it would probably be more obvious and clear to say this at the very begining, e.g.
> "Get that Linux feeling (with all those differents and distinctions) - on Windows"
> 
>> Use of // in Linux is already on shaky ground, given that POSIX has 
>> already declared it to be implementation-defined.
> Shaky ground? There must be some good reasons (beyond the declaration of such an abstarct
> possibility) that it should to be done differently than it has been so far.

POSIX Rationale for Pathname Resolution:
http://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xbd_chap04.html#tag_21_04_13

Notes:
POSIX agrees to standardize what is common among their IEEE, OpenGroup, ISO, and
IEC members implementations.

Eric, and some of the other maintainers on Cygwin lists, are also participants
in POSIX, so they have background, knowledge, and experience there.

Background:
BSD diverged from AT&T to support TCP/IP networking and sockets instead of telco
OSI and streams, then each of the BSDs went their own ways; many vendors joined
consortiums to agree on features, took some of these approaches, and implemented
them with their own proprietary tweaks; Linux was based on one of these
implementations (Solaris, with SysV unification on SunOS BSD base); the rest was
based on GNU, designed to remove limits built into the SysV and BSD libraries
and utilities (I got into this stuff after I hit 128... line length and other
limits in various utilities and systems): the world is not only Linux or GNU;
the commercial world is heavily SysV and/or BSD based; guess who pays to
participate?
IBM, MS, HPE, and others participate to ensure that POSIX maintains conformance
for their systems, so they comply to US FIPS, and can bid them on US .gov and
.mil contracts. (WSL anyone?) ;^>

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

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

