diff options
author | Ondrej Mosnacek <omosnace@redhat.com> | 2020-12-14 16:36:27 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2020-12-15 14:12:08 +0100 |
commit | 7b87bece5ded3e8f068df8402901198c069ab5cf (patch) | |
tree | edbd4ba3282bc754681dc5cf5b53e6a92a4a9265 /src/resolve/resolved-resolv-conf.c | |
parent | fc874bf3bf3e5403b9b60fd23281d9623b864466 (diff) | |
download | systemd-7b87bece5ded3e8f068df8402901198c069ab5cf.tar.gz |
resolved: create stub-resolv.conf symlink with correct security label
Use symlink_atomic_label() instead of symlink_atomic() as the symlink
may need a different label than the parent directory.
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
Diffstat (limited to 'src/resolve/resolved-resolv-conf.c')
-rw-r--r-- | src/resolve/resolved-resolv-conf.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/resolve/resolved-resolv-conf.c b/src/resolve/resolved-resolv-conf.c index 33fc435a9a..029d5c93ed 100644 --- a/src/resolve/resolved-resolv-conf.c +++ b/src/resolve/resolved-resolv-conf.c @@ -10,6 +10,7 @@ #include "fd-util.h" #include "fileio.h" #include "fs-util.h" +#include "label.h" #include "ordered-set.h" #include "resolved-conf.h" #include "resolved-dns-server.h" @@ -364,7 +365,7 @@ int manager_write_resolv_conf(Manager *m) { log_error_errno(r, "Failed to move new %s into place: %m", PRIVATE_STUB_RESOLV_CONF); } else { - r = symlink_atomic(basename(PRIVATE_UPLINK_RESOLV_CONF), PRIVATE_STUB_RESOLV_CONF); + r = symlink_atomic_label(basename(PRIVATE_UPLINK_RESOLV_CONF), PRIVATE_STUB_RESOLV_CONF); if (r < 0) log_error_errno(r, "Failed to symlink %s: %m", PRIVATE_STUB_RESOLV_CONF); } |