delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2018/03/12/19:39:16

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:from:reply-to:to:cc:subject:message-id
:in-reply-to:references:mime-version:content-type
:content-transfer-encoding; q=dns; s=default; b=H0P2Lx54iyVM5jzi
zt0hTMZibfx68aBZ/nUHWV5FGa980PIKYbymIFRkkWmx5XkELmzRp4HgDEub3tOc
uM24E5K/nffA1f+fnD32x/8fWs3XPpq5SoC0Cw/VB6sYUctBFwccuXYan9+Atz8m
VnOl5b/4HVbKQISemiVzxEPRoGM=
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:from:reply-to:to:cc:subject:message-id
:in-reply-to:references:mime-version:content-type
:content-transfer-encoding; s=default; bh=3F2Bw1vYrzuTqKXx/iqFf8
FVxXE=; b=giM34mq4BsdcqPkRpn+EtrRoSYX0y5xaGBw2GULmcCBPXBoI3VRonO
q/tMIff5/T0o9qzEZF4P/cDCrsscvlCSSCK/uXkjYVChEKZaSy82VKb7HziQjtBg
j1RmG0TU8fs7KyFMQauwfVEOEza8jyxpIVJvyqR/Ipn66oZV6qpqU=
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-Virus-Found: No
X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=unc, UNC, valued, UD:ru
X-HELO: smtp21.mail.ru
Date: Tue, 13 Mar 2018 02:38:54 +0300
From: "Mikhail Usenko via cygwin" <cygwin AT cygwin DOT com>
Reply-To: Mikhail Usenko <cygwin AT inbox DOT ru>
To: cygwin AT cygwin DOT com
Cc: Mikhail Usenko <cygwin AT inbox DOT ru>
Subject: Re: [bug] coreutils: potentially dangerous: $(realpath //) != /
Message-Id: <20180313023854.2e07e4396f934961935e4435@inbox.ru>
In-Reply-To: <20180312232815.692b5da79fc18abf86d42ba1@inbox.ru>
References: <20180312232815 DOT 692b5da79fc18abf86d42ba1 AT inbox DOT ru>
Mime-Version: 1.0
Authentication-Results: smtp21.mail.ru; auth=pass smtp.auth=cygwin AT inbox DOT ru smtp.mailfrom=cygwin AT inbox DOT ru
X-7FA49CB5: 0D63561A33F958A5AFADDB97F551C081311759FDA36AE23886070F20E61CB89D725E5C173C3A84C33894EB66659600D5E4FF731C5E241A4E33F64B4C514AF25EC4224003CC836476C0CAF46E325F83A50BF2EBBBDD9D6B0F2AF38021CC9F462D574AF45C6390F7469DAA53EE0834AAEE
X-Mailru-Sender: 6EC2BC89932334D1F7B5BD7C7EAE77D3AD61939CBD171F0DE8BA2ADC61007D889ABDE2F3ADEBC21B660F59C8B746F306C436427D37DF329266E4D333E66FA46EE08AD13A84CB3945E26AC9D112D2F5D8C42AFB4B603C56BB0DA7A0AF5A3A8387
X-IsSubscribed: yes

On Mon, 12 Mar 2018 21:47:09 +0100
Achim Gratz <...> wrote:
> This goes to show that you really, really, really want to understand the corner
> cases in this script.

On Mon, 12 Mar 2018 15:41:00 -0500
Eric Blake <...> wrote:
> On cygwin, '/' and '//' are two different directories, as allowed by 
> POSIX. Converting // into / is a violation of the POSIX requirements on 
> pathname resolution on systems where // is distinct from /.
> ...
> If you want to guarantee that an arbitrary variable concatenated 
> with / and then a glob expands into the expected directory, then YOU 
> have to prefilter the arbitrary variable to make sure it does not 
> consist solely of slashes. 

Well, guys my expextations are that the program/script execution conditions
in Cygwin should be the same as in other popular POSIX systems
(namely it is Linux) 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.

If at some time it was considered that
$ ls //Server/Folder
in Cygwin should behave like
> net view \\Server\Folder
in Windows to be able to view network shares, I belive this could be realized
with using of some special folder e.g. /cygnetwork, like /cygdrive does it for
Windows drives.
Supporting of UNC paths that are actually off the POSIX unified tree, directly
for POSIX user commands, breaks consistency with Linux user environment, which
is the feature of Cygwin that is highly valued by the most of the users.



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