[vlc-devel] [PATCH] $HOME envvar should be checked before getpwuid()
benoar at free.fr
benoar at free.fr
Tue Oct 16 18:11:59 CEST 2007
Selon Rafaël Carré <funman at videolan.org>:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> Benjamin Cama a écrit :
> > Hi,
> > VLC behavior concerning where to look for user's home directory is a bit
> > broken (it killed my afternoon ...) : it should check $HOME before going
> > getpwuid (see man getpwuid). This patch corrects this, checking in this
> > order :
> > $HOME -> getpwuid() -> $TMP -> /tmp
> > (before was getpwuid() -> $HOME -> $TMP -> /tmp)
> > It was also not tested ....
> > Please CC me for any anwser, as i'm not subscribed.
> > Regards,
> > Benjamin
> Committed, thanks.
> Note that the english man page doesn't talk about HOME, opposed to the
> french man page.
> I suppose french man page is a translation of
> http://kerneltrap.org/man/linux/man3/getpwuid.3 .
> And the english man page comes from
> http://www.opengroup.org/onlinepubs/007908799/xsh/getpwuid.html which
> should be considered as the "official" man page.
Oops, I actually only checked the french man page, and did not see that it
wasn't there on the original (english) one.
> But we can consider it's safe to rely on $HOME first before anything else ;)
Yes, I think. $HOME is set during login, with the value from getpwuid(), but
sometimes in some special case (like mine, where the system has a read-only root
FS and I copy the home in a writable directory), I change HOME for some other
directory and hope that every software cope with that. VLC is the only one that
did not follow that scheme (Firefox, among (a few) others, uses $HOME first ...
in fact, I don't know if it ever checks getpwuid() ...)
> - --
> Rafaël Carré
More information about the vlc-devel