Use of g_getenv("HOME")

Moritz Heiber MisterMoe at
Wed Feb 26 00:09:56 CET 2003

On Wed, 26 Feb 2003 00:06:50 +0100
Benedikt Meurer <Benedikt.Meurer at> wrote:

> Hello again(2),
> During the xfce4 sources g_getenv("HOME") is used to determine the users
> home directory. This is somewhat problematic as $HOME doesn't always
> contain the correct home directory (e.g. using su(1) or sudo(8)).
> g_get_home_dir() should be used instead to avoid the problem above. In
> addition g_get_home_dir() is ment to be a portable way to determine the
> home directory, in case a systems login or xinit program doesn't export
> $HOME, the path can be easily archived from the systems user database
> (e.g. on nearly all Unix systems /etc/passwd).
> I've done a patch for xfce-utils so far; the other modules should also
> be changed.
> I've also thought of adding an utility library to xfce which provides
> miscalleanous utility functions. For example xfce_get_user_dir() to
> return the path to the users $HOME/.xfce4, which could also allow
> the user to change this path by setting an enviroment variable (for
> example KDE uses $KDEHOME, which is quite handy in certain conditions).
> regards,
> Benedikt
> -- 
> Those who do not understand Unix are condemned to reinvent it, poorly.
>     -- Henry Spencer

And I say get this guy CVS access ;-)



More information about the Xfce4-dev mailing list