diff options
author | Lennart Poettering <lennart@poettering.net> | 2024-09-03 10:52:16 +0200 |
---|---|---|
committer | Daan De Meyer <daan.j.demeyer@gmail.com> | 2024-09-11 21:34:51 +0200 |
commit | 368051ee6b6c75b9bccec8df021f1d98953f46be (patch) | |
tree | b03320ff09cdd1cc4b601a0f17d586bf8ea830e5 /src/resolve/resolved-manager.c | |
parent | Merge pull request #34377 from DaanDeMeyer/symlinks (diff) | |
download | systemd-368051ee6b6c75b9bccec8df021f1d98953f46be.tar.xz systemd-368051ee6b6c75b9bccec8df021f1d98953f46be.zip |
resolved: use unlinkat() where appropriate
Diffstat (limited to '')
-rw-r--r-- | src/resolve/resolved-manager.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/resolve/resolved-manager.c b/src/resolve/resolved-manager.c index c842bf69c5..5f92684215 100644 --- a/src/resolve/resolved-manager.c +++ b/src/resolve/resolved-manager.c @@ -1726,7 +1726,6 @@ void manager_cleanup_saved_user(Manager *m) { } FOREACH_DIRENT_ALL(de, d, log_error_errno(errno, "Failed to read interface directory: %m")) { - _cleanup_free_ char *p = NULL; int ifindex; Link *l; @@ -1750,13 +1749,8 @@ void manager_cleanup_saved_user(Manager *m) { continue; rm: - p = path_join("/run/systemd/resolve/netif", de->d_name); - if (!p) { - log_oom(); - return; - } - - (void) unlink(p); + if (unlinkat(dirfd(d), de->d_name, 0) < 0) + log_warning_errno(errno, "Failed to remove left-over interface configuration file '%s', ignoring: %m", de->d_name); } } |