[systemd-bugs] [Bug 62344] tests depend on /etc/machine-id

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Mar 14 09:55:24 PDT 2013


https://bugs.freedesktop.org/show_bug.cgi?id=62344

--- Comment #3 from Martin Pitt <martin.pitt at ubuntu.com> ---
Would it be acceptable to do something like this, and set it in the tests?

-        fd = open("/etc/machine-id", O_RDONLY|O_CLOEXEC|O_NOCTTY);
+        machine_id_path = getenv("SYSTEMD_MACHINE_ID_PATH");
+        if (machine_id_path == NULL)
+                machine_id_path = "/etc/machine-id";
+        fd = open(machine_id_path, O_RDONLY|O_CLOEXEC|O_NOCTTY);

Security wise it should not matter much, as you can also use LD_PRELOAD to
divert the path.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-bugs/attachments/20130314/397df418/attachment.html>


More information about the systemd-bugs mailing list