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

Re: ${HOME} vs. g_get_home_dir ()

Le jeudi 27 septembre 2012 à 14:39 -0700, Josh Triplett a écrit : 
> Agreed entirely.  In particular, it breaks the very common use case of
> running a program with sudo.  "sudo foo" leaves $HOME set to the user's
> home directory rather than root, so that foo will use the same
> configuration either way.  

This is a bug in sudo. There can be very dangerous things in $HOME (such
as scriptable application configuration files), and they should clearly
be ignored in favor of those of root.

> A user can then use sudo -H or sudo -i if
> they want a more rootish environment.  Other programs that don't respect
> $HOME include ssh, which forces ugly workarounds like this:
> sudo ssh -o UserKnownHostsFile=$HOME/.ssh/known_hosts ...

This is desired. Allowing to use another user’s known_hosts, which can
have been fiddled with, is dangerous.

 .''`.      Josselin Mouette
: :' :
`. `'

Reply to: