summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-09-25 09:58:29 -0400
committerMartin Pitt <martin.pitt@ubuntu.com>2016-10-01 22:53:17 +0200
commita63ee40751ee3cae053470f4e0fb0016fbc40f25 (patch)
tree90523f6a035d206430c464d34fc6f7ceef084e8b /src/core
parentd941ea22e39673414eac941226e41a1d12a41e46 (diff)
core: do not try to create /run/systemd/transient in test mode
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.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/manager.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/manager.c b/src/core/manager.c
index e63b31bdf3..dd0d1fa984 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -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);