From 46a3c51f58062e5f24f548a08a14940d38c63f71 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 7 Jun 2017 14:47:12 +0100 Subject: [PATCH 09/11] Unix sysdeps: Only copy /etc/machine-id to ${sysconfdir} in "ensure" mode System integration scripts use dbus-uuidgen --ensure, so they are unaffected by this, and in particular the solution to Bug #77941 is still valid. The shared library is typically loaded by unprivileged users, so trying to write out the machine-id file is not going to work anyway. However, if we *can* write to our ${sysconfdir} - notably during `make distcheck` - then it is unexpected that merely reading the machine ID has the side-effect of writing to ${sysconfdir}, and in particular it will make the check for a complete uninstall fail. We definitely must not delete the machine ID during `make uninstall`. Signed-off-by: Simon McVittie --- dbus/dbus-sysdeps-unix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c index 8b6ac306..e0440fe4 100644 --- a/dbus/dbus-sysdeps-unix.c +++ b/dbus/dbus-sysdeps-unix.c @@ -3920,7 +3920,7 @@ _dbus_read_local_machine_uuid (DBusGUID *machine_id, _dbus_string_init_const (&filename, "/etc/machine-id"); b = _dbus_read_uuid_file (&filename, machine_id, FALSE, error); - if (b) + if (create_if_not_found && b) { /* try to copy it to the DBUS_MACHINE_UUID_FILE, but do not * complain if that isn't possible for whatever reason */ -- 2.11.0