This is the mail archive of the
mailing list for the Cygwin project.
Re: [bug] coreutils: potentially dangerous: $(realpath //) != /
- From: "Mikhail Usenko via cygwin" <cygwin at cygwin dot com>
- To: cygwin at cygwin dot com
- Cc: Mikhail Usenko <cygwin at inbox dot ru>
- Date: Tue, 13 Mar 2018 02:38:54 +0300
- Subject: Re: [bug] coreutils: potentially dangerous: $(realpath //) != /
- Authentication-results: sourceware.org; auth=none
- Authentication-results: smtp21.mail.ru; auth=pass smtp.auth=cygwin at inbox dot ru smtp.mailfrom=cygwin at inbox dot ru
- References: <email@example.com>
- Reply-to: Mikhail Usenko <cygwin at inbox dot ru>
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
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
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple