$HOME changed by sudo
steve.langasek at ubuntu.com
Thu Feb 17 23:29:04 UTC 2011
On Thu, Feb 17, 2011 at 06:20:46PM -0500, Barry Warsaw wrote:
> On Feb 17, 2011, at 11:55 PM, Benjamin Drung wrote:
> >I detected that sudo in natty changes $HOME to /root . Is this a bug
> >or a changed configuration?
> >It had the bad side effect that "sudo pbuilder" didn't find
> > sudo sh -c 'echo $HOME'
> Isn't this an effect of sudo no longer preserving the environment by default?
> I've seen that behavior since Maverick. It's why 'sudo -E' is now in my
> muscle memory. ;)
> $ sudo -E sh -c 'echo $HOME'
No, $HOME had been whitelisted internally. The behavior in maverick vs.
natty is different from what I see, despite 'env_reset' being the default.
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer http://www.debian.org/
slangasek at ubuntu.com vorlon at debian.org
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 828 bytes
Desc: Digital signature
More information about the ubuntu-devel