$HOME changed by sudo

Benjamin Drung bdrung at ubuntu.com
Thu Feb 17 23:29:33 UTC 2011


Am Donnerstag, den 17.02.2011, 18:20 -0500 schrieb Barry Warsaw:
> On Feb 17, 2011, at 11:55 PM, Benjamin Drung wrote:
> 
> >I detected that sudo in natty changes $HOME to /root [1]. Is this a bug
> >or a changed configuration?
> >
> >It had the bad side effect that "sudo pbuilder" didn't find
> >~/.pbuilderrc.
> >
> >[1] sudo sh -c 'echo $HOME'
> 
> Isn't this an effect of sudo no longer preserving the environment by default?

No. My maverick machine has "Defaults env_reset" in /etc/sudors and the
command from [1] still returns my home directory.

Looking at the man page of sudo, I found -H saying "By default, sudo
does not modify HOME"

-- 
Benjamin Drung
Debian & Ubuntu Developer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <https://lists.ubuntu.com/archives/ubuntu-devel/attachments/20110218/b73506dd/attachment.pgp>


More information about the ubuntu-devel mailing list