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:reply-to:subject:to:references:from:message-id :date:mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=XCowNBy3Ot2ku2gp Xxvzo3XLacgDj0jUKaLt1qVoNVHC5i7WNPNKKzhtizpkUPbS+m4M5UGdAX3gDbgT 0J9i/M+9C0qJiYYn+6cYWz/BQLOzCDKzlahT0oPz8F79sVdw4O76uV+Vt/n1J4p9 LvcSch+KCZAkR9UXXMwj6DoWl4A= 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=wY2dg8ObdU6/p05OREsc/j 3U56w=; b=ZeVws1yRnWO1+VItF0M5k0XFpBBA5xHXE7aEGY/0HB2RlsdsHX/JPU j1K+zHjzJ9puRt7kbtrIETG02uiVvbBuPTRnPetPbtl+jSblw7+xBoVaG+QT4VqU sq5ZxRh5RWGND+Ezz6LROrW/DfARssHyjv8fyqqvbfmv1yBbEiSAE= 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-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=claims, HContent-Transfer-Encoding:8bit X-HELO: smtp-out-no.shaw.ca X-Authority-Analysis: v=2.3 cv=X6B81lbe c=1 sm=1 tr=0 a=MVEHjbUiAHxQW0jfcDq5EA==:117 a=MVEHjbUiAHxQW0jfcDq5EA==:17 a=IkcTkHD0fZMA:10 a=rgBQ4hhxdAUbospp6FkA:9 a=lTAOM7zWRXSSMKw8:21 a=w_uieKu4bV5hZQOr:21 a=QEXdDO2ut3YA:10 Reply-To: Brian DOT Inglis AT SystematicSw DOT ab DOT ca Subject: Re: [bug] coreutils: potentially dangerous: $(realpath //) != / To: cygwin AT cygwin DOT com References: <20180312232815 DOT 692b5da79fc18abf86d42ba1 AT inbox DOT ru> <20180313023854 DOT 2e07e4396f934961935e4435 AT inbox DOT ru> <0277f5b4-35e4-4da0-2bea-b73c4fdcfa89 AT redhat DOT com> <20180314135845 DOT caeb571cdd5a54fc5b3fd4aa AT inbox DOT ru> <5a588f7d-8f9d-4126-4467-1626304cd89f AT towo DOT net> From: Brian Inglis Message-ID: <48847961-6d22-77ae-14a5-61a5386496da@SystematicSw.ab.ca> Date: Sat, 17 Mar 2018 00:15:58 -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: <5a588f7d-8f9d-4126-4467-1626304cd89f@towo.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4wfMRAZDJT76GxbZUQGOahewWG3shgyb5/vm30rOPJazFpi61dZ5b6yWlz8R/dyTPE4LItyjMjZHYy0uL8iWNA5P3YpWUrewI0UtoqKdxS1fNM+EgQexT7 0Xs9K00u1MRBJUTimsRpF/VUUbfdMEgLoArOa91jObYs/uw2dNgVLXwHYqpq0S3HvCodJ9y5Ibvdgg== X-IsSubscribed: yes On 2018-03-15 01:11, Thomas Wolff wrote: > Am 14.03.2018 um 11:58 schrieb Mikhail Usenko via cygwin: >> On Mon, 12 Mar 2018 20:43:13 -0500 >> Eric Blake <...> wrote: >>> Just because Linux has taken the stance that their documented definition >>> of // is "synonym for /" does NOT mean that ALL POSIX systems have taken >>> the same approach; Cygwin has taken the approach that "// is documented >>> to be the root of network access points, distinct from /". >>> >>> 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. >> 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), > which is not the case. There are other systems where // is the network root. >> then it would probably be more obvious and clear to say this at the very >> beginning, e.g. "Get that Linux feeling (with all those differences and >> distinctions) - on Windows" > Considering that due to the limitations of being embedded in Windows, Cygwin > cannot always perfectly mimic either Linux or POSIX systems, I personally prefer > the more generic approach to define POSIX as its model. It's comforting to know that if a script arg is supplied as / and used as the target of rmdir $v/ or rm -rf $v/..., it won't do anything. (Although any such args should always be canonicalized, then checked to ensure they are not, whether deliberately or inadvertently, null, $PWD or any prefix, /, or other significant standard paths.) -- 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