Check $HOME and home dir of $USER before getpwuid()->pw_dir
authorDmitry Bogatov <KAction@gnu.org>
Sun, 29 May 2016 09:56:51 +0000 (11:56 +0200)
committerQuentin Rameau <quinq@fifth.space>
Tue, 5 Jul 2016 11:01:56 +0000 (13:01 +0200)
commitcee8f0186ce3277add9b6a8ac07588be40f0f080
tree237d094d90ca3497343b179e7a4d8c91b8f0e101
parent3530d18d8ed04710d5e5a0bfbf6af948c59549bf
Check $HOME and home dir of $USER before getpwuid()->pw_dir

getpwnam(3) recommends to use $HOME instead of getpwuid()->pw_dir,
as it allows users to point programs to a different path.

Using getpwuid() also breaks namespaces-related use cases,
like `unshare -r`.

Patch was submitted by Dmitry Bogatov on the Debian bug tracker:
https://bugs.debian.org/825397

Signed-off-by: Christoph Lohmann <20h@r-36.net>
surf.c