diff options
author | Lennart Poettering <lennart@poettering.net> | 2017-09-26 18:27:56 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2017-09-27 17:53:00 +0200 |
commit | 1af87ab7d65b102e3ce5a64e8b47e4d08fc407a0 (patch) | |
tree | 8c94b10f117f036198bd5351c6a42444841765f7 /src/core/socket.c | |
parent | socket: make sure we warn loudly about symlinks we can't create (diff) | |
download | systemd-1af87ab7d65b102e3ce5a64e8b47e4d08fc407a0.tar.xz systemd-1af87ab7d65b102e3ce5a64e8b47e4d08fc407a0.zip |
socket: create leading directories for socket symlinks
It really doesn't hurt creating prefix directories if necessary, as we
tend to do that for other file nodes we create, too.
Fixes: #6920
Diffstat (limited to 'src/core/socket.c')
-rw-r--r-- | src/core/socket.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/socket.c b/src/core/socket.c index d1d4007588..157a6dbae7 100644 --- a/src/core/socket.c +++ b/src/core/socket.c @@ -1175,7 +1175,7 @@ static int fifo_address_create( assert(path); - mkdir_parents_label(path, directory_mode); + (void) mkdir_parents_label(path, directory_mode); r = mac_selinux_create_file_prepare(path, S_IFIFO); if (r < 0) @@ -1334,6 +1334,8 @@ static int socket_symlink(Socket *s) { return 0; STRV_FOREACH(i, s->symlinks) { + (void) mkdir_parents_label(*i, s->directory_mode); + r = symlink_idempotent(p, *i); if (r < 0) log_unit_warning_errno(UNIT(s), r, "Failed to create symlink %s → %s, ignoring: %m", p, *i); |