[Top][All Lists]

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

Re: Bash should reset OLDPWD upon login, *only*.

From: Chet Ramey
Subject: Re: Bash should reset OLDPWD upon login, *only*.
Date: Mon, 2 Oct 2017 16:15:33 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.3.0

On 10/1/17 7:30 PM, L A Walsh wrote:

> Only in the case of login -- they user CAN'T set it before they login, but
> someone **could** have changed the system /etc/profile script to set OLDPWD
> to /hang (i.e. someone is behaving "maliciously"). 

Login shells rarely get OLDPWD from the environment. How about checking
OLDPWD only if it appears in the environment, which would avoid the
set-maliciously-in-etc-profile problem?

That is consistent with the current behavior for importing PWD.

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

reply via email to

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