summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2017-07-28 08:38:20 +0100
committerSimon McVittie <smcv@debian.org>2017-07-28 16:12:24 +0100
commit3f377c511301cfb36bfa93fddf1f59ace8580749 (patch)
tree86912b385812a3d9957049b738d26a1f7cd27e96 /test
parent94f6c651f835411bb8c2c08f6d7b33397447ea40 (diff)
userdb: Respect $HOME for the home directory of our own uid
This lets cooperating processes with the same value of $HOME interoperate for DBUS_COOKIE_SHA1 by reading and writing $HOME, even if their $HOME differs from the uid's "official" home directory according to getpwuid(). Out of paranoia, we only do this if the uid and the euid are equal, since if they were unequal the correct thing to do would be ambiguous. In particular, Debian autobuilders run as a user whose "official" home directory in /etc/passwd is "/nonexistent", as a mechanism to detect non-deterministic build processes that rely on the contents of the home directory. Until now, this meant we couldn't run dbus' build-time tests, because every test that used DBUS_COOKIE_SHA1 would fail in this environment. In the tests, set HOME as well as DBUS_TEST_HOMEDIR. We keep DBUS_TEST_HOMEDIR too, because Windows doesn't use HOME, only HOMEDRIVE and HOMEPATH. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101960 Bug-Debian: https://bugs.debian.org/630152 Signed-off-by: Simon McVittie <smcv@debian.org> Reviewed-by: Philip Withnall <withnall@endlessm.com>
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.am2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/Makefile.am b/test/Makefile.am
index 7f6362f3..2003d352 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -246,6 +246,7 @@ installcheck_environment = \
export DBUS_TEST_HOMEDIR=@abs_top_builddir@/dbus; \
export DBUS_TEST_DATADIR=$(DESTDIR)$(datadir); \
export DBUS_TEST_UNINSTALLED=1; \
+ export HOME=@abs_top_builddir@/dbus; \
${NULL}
# Tests in bus/config-parser.c rely on these specific values for XDG_* and
@@ -267,6 +268,7 @@ AM_TESTS_ENVIRONMENT = \
export DBUS_TEST_EXEC=@abs_top_builddir@/test; \
export DBUS_TEST_HOMEDIR=@abs_top_builddir@/dbus; \
export DBUS_TEST_UNINSTALLED=1; \
+ export HOME=@abs_top_builddir@/dbus; \
$(NULL)
manual_authz_SOURCES = manual-authz.c