[sane-devel] [sane-commit] CVS update of sane-backends (3 files)
Julien BLACHE
jb at jblache.org
Sat Dec 6 16:31:48 UTC 2008
Louis Lagendijk <llagendijk-guest at alioth.debian.org> wrote:
Hi,
> backend/pixma_bjnp.c pixma_bjnp_private.h
> On Ubuntu getlogin() returns NULL. So we noew first try getlogin()
> and if that fails, we try getenv("USER") and if that fails we use
> a defaul user string
You want geteuid() + getpwuid() instead of getlogin() which relies on
utmp and thus is unreliable.
Also, never trust an environment variable.
JB.
--
Julien BLACHE <http://www.jblache.org>
<jb at jblache.org> GPG KeyID 0xF5D65169
More information about the sane-devel
mailing list