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

Bug#597581: update-initramfs should not set PATH



Ben Hutchings writes ("Re: Bug#597581: update-initramfs should not set PATH"):
> > Firstly, the argument you made above, that update-initramfs is called
> > "automatically by package installation", seems to be based on the idea
> > that this is a good reason for setting the PATH.
> 
> My point was that it's called both from interactive shells *and* from
> package upgrades, and there's no reason to think $PATH will be
> consistent between those.

Package upgrades are often run from interactive shells and there is
nothing in the the package upgrade machinery which modifies PATH.

The logic of your argument would seem to apply to almost any program.
Should texmf reset PATH, say ?  I think clearly not.

> > Secondly, note "These considerations really apply to all shell
> > scripts".
> 
> Yet most init scripts reset the PATH because this turns out to be a bad
> idea in reality.
> 
> $ grep -rl 'PATH=[^$]*$' /etc/init.d | wc -l
> 63
> $ grep -rL 'PATH=[^$]*$' /etc/init.d | wc -l
> 44

Daemons are arguably a special case, particularly because many of them
spawn other processes of a very general nature that oughtn't to
inherit an exciting environment.

Ian.


Reply to: