]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: do not try to create /run/systemd/transient in test mode
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 25 Sep 2016 13:58:29 +0000 (09:58 -0400)
committerMartin Pitt <martin.pitt@ubuntu.com>
Sat, 1 Oct 2016 20:53:17 +0000 (22:53 +0200)
This prevented systemd-analyze from unprivileged operation on older systemd
installations, which should be possible.
Also, we shouldn't touch the file system in test mode even if we can.

src/core/manager.c

index e63b31bdf34e44f4cb6c9577618d4cb6de2c21d3..dd0d1fa984cb2ff1106fa81c417f1106ad812de2 100644 (file)
@@ -1236,9 +1236,11 @@ int manager_startup(Manager *m, FILE *serialization, FDSet *fds) {
                 return r;
 
         /* Make sure the transient directory always exists, so that it remains in the search path */
-        r = mkdir_p_label(m->lookup_paths.transient, 0755);
-        if (r < 0)
-                return r;
+        if (!m->test_run) {
+                r = mkdir_p_label(m->lookup_paths.transient, 0755);
+                if (r < 0)
+                        return r;
+        }
 
         dual_timestamp_get(&m->generators_start_timestamp);
         r = manager_run_generators(m);