Bug 101960 - Make DBUS_COOKIE_SHA1 respect $HOME
Summary: Make DBUS_COOKIE_SHA1 respect $HOME
Status: RESOLVED FIXED
Alias: None
Product: dbus
Classification: Unclassified
Component: core (show other bugs)
Version: git master
Hardware: Other All
: medium normal
Assignee: Simon McVittie
QA Contact: D-Bus Maintainers
URL:
Whiteboard:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2017-07-28 10:13 UTC by Simon McVittie
Modified: 2017-07-28 17:50 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
userdb: Respect $HOME for the home directory of our own uid (3.32 KB, patch)
2017-07-28 10:13 UTC, Simon McVittie
Details | Splinter Review

Description Simon McVittie 2017-07-28 10:13:59 UTC
Created attachment 133095 [details] [review]
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.
Comment 1 Philip Withnall 2017-07-28 11:09:14 UTC
Comment on attachment 133095 [details] [review]
userdb: Respect $HOME for the home directory of our own uid

Review of attachment 133095 [details] [review]:
-----------------------------------------------------------------

r+
Comment 2 Simon McVittie 2017-07-28 17:50:45 UTC
Thanks, fixed in git for 1.11.18


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.