[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bash should reset OLDPWD upon login, *only*.
From: |
Greg Wooledge |
Subject: |
Re: Bash should reset OLDPWD upon login, *only*. |
Date: |
Tue, 3 Oct 2017 16:50:27 -0400 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
On Tue, Oct 03, 2017 at 10:36:17PM +0200, Mikulas Patocka wrote:
> The problem is that $OLDPWD causes unintended activations of the
> automounter and unintended delays. For example
> /root# cd /some/automounted/directory
> /some/automounted/directory# cd ~
> /root# /etc/init.d/mail-daemon start
>
> - now, the mail daemon inherits OLDPWD=/some/automounted/directory and
> every incoming email will poke this directory and activate the automounter
> and cause delay.
To be fair, there are several things that have to happen in order for
this problem to arise:
1) The system must be using sysv-rc style init scripts, and not any of
the other init systems where the interactive environment doesn't
leak into daemons in the first place.
2) The mail-daemon (and the init.d scripts which launch it) must not
cleanse the environment.
3) The mail-daemon must invoke a bash script, specified directly in the
shebang, or via a /bin/sh -> bash symlink.
4) The sysadmin has to get unlucky with respect to the order in which
tasks are performed within a single shell session.
I'm not doubting that there exist some systems where all of these
conditions may be simultaneously met, but it's quite a stack.
The question remains: what, if anything, should be changed?
- Re: [PATCH] Fix hang if $OLDPWD points to inaccessible directory, Mikulas Patocka, 2017/10/01
- Bash should reset OLDPWD upon login, *only*., L A Walsh, 2017/10/01
- Re: Bash should reset OLDPWD upon login, *only*., Chet Ramey, 2017/10/02
- Re: Bash should reset OLDPWD upon login, *only*., Mikulas Patocka, 2017/10/03
- Re: Bash should reset OLDPWD upon login, *only*.,
Greg Wooledge <=
- Re: Bash should reset OLDPWD upon login, *only*., L A Walsh, 2017/10/03
- Re: Bash should reset OLDPWD upon login, *only*., Eduardo Bustamante, 2017/10/03
- Re: Bash should reset OLDPWD upon login, *only*., L A Walsh, 2017/10/03