diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 03:50:40 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 03:50:40 +0000 |
commit | fc53809803cd2bc2434e312b19a18fa36776da12 (patch) | |
tree | b4b43bd6538f51965ce32856e9c053d0f90919c8 /src/network/networkd.c | |
parent | Adding upstream version 255.5. (diff) | |
download | systemd-fc53809803cd2bc2434e312b19a18fa36776da12.tar.xz systemd-fc53809803cd2bc2434e312b19a18fa36776da12.zip |
Adding upstream version 256.upstream/256
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/network/networkd.c')
-rw-r--r-- | src/network/networkd.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/network/networkd.c b/src/network/networkd.c index 46c2c74..69a2864 100644 --- a/src/network/networkd.c +++ b/src/network/networkd.c @@ -18,6 +18,7 @@ #include "networkd-manager.h" #include "service-util.h" #include "signal-util.h" +#include "strv.h" #include "user-util.h" static int run(int argc, char *argv[]) { @@ -69,17 +70,13 @@ static int run(int argc, char *argv[]) { /* Always create the directories people can create inotify watches in. * It is necessary to create the following subdirectories after drop_privileges() * to support old kernels not supporting AmbientCapabilities=. */ - r = mkdir_safe_label("/run/systemd/netif/links", 0755, UID_INVALID, GID_INVALID, MKDIR_WARN_MODE); - if (r < 0) - log_warning_errno(r, "Could not create runtime directory 'links': %m"); - - r = mkdir_safe_label("/run/systemd/netif/leases", 0755, UID_INVALID, GID_INVALID, MKDIR_WARN_MODE); - if (r < 0) - log_warning_errno(r, "Could not create runtime directory 'leases': %m"); - - r = mkdir_safe_label("/run/systemd/netif/lldp", 0755, UID_INVALID, GID_INVALID, MKDIR_WARN_MODE); - if (r < 0) - log_warning_errno(r, "Could not create runtime directory 'lldp': %m"); + FOREACH_STRING(p, + "/run/systemd/netif/links/", + "/run/systemd/netif/leases/") { + r = mkdir_safe_label(p, 0755, UID_INVALID, GID_INVALID, MKDIR_WARN_MODE); + if (r < 0) + log_warning_errno(r, "Could not create directory '%s': %m", p); + } r = manager_new(&m, /* test_mode = */ false); if (r < 0) |