bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PWD not made canonical on shell start


From: Chet Ramey
Subject: Re: PWD not made canonical on shell start
Date: Wed, 24 May 2017 11:53:45 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.1.1

On 5/23/17 9:51 AM, idallen@idallen-fibe.dyndns.org wrote:

> Bash Version: 4.3
> Patch Level: 48
> Release Status: release
> 
> Description:
>       In both BASH and DASH the shell variable $PWD is not always set
>       by the shell on start-up to be the actual absolute path to the
>       current directory.  If PWD is passed in via the environment, it
>       is used *as-is* as long as it is an absolute path and whatever
>       directory it resolves to is the *same* as the current directory.

That is, by definition, an "actual absolute path to the current
directory."

>       This means you can pass in some crazy /././ and /../../../
>       pathnames via PWD and the shell will use them as-is.
Not any more: bash-4.4 canonicalizes absolute pathnames it gets as
the value of PWD in the initial environment, and only trusts absolute
pathnames as potential values of PWD.

It was changed back in 2015 as the result of

http://lists.gnu.org/archive/html/bug-bash/2015-09/msg00053.html

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]