fs-util: replace symlink_atomic_full_label() by a flag to symlinkat_atomic_full()

More porting work to label_ops_pre()/label_ops_post()

This also enables labelling of the /etc/localtime symlink in
systemd-firstboot, which should address one small facet of #37857
This commit is contained in:
Lennart Poettering
2025-06-18 10:21:25 +02:00
parent 2c7f35b144
commit 9ea5a6e7d6
9 changed files with 32 additions and 38 deletions
+1 -3
View File
@@ -2471,9 +2471,7 @@ static int create_symlink(Context *c, Item *i) {
fd = safe_close(fd);
mac_selinux_create_file_prepare(i->path, S_IFLNK);
r = symlinkat_atomic_full(i->argument, pfd, bn, /* make_relative= */ false);
mac_selinux_create_file_clear();
r = symlinkat_atomic_full(i->argument, pfd, bn, SYMLINK_LABEL);
if (IN_SET(r, -EISDIR, -EEXIST, -ENOTEMPTY)) {
r = rm_rf_child(pfd, bn, REMOVE_PHYSICAL);
if (r < 0)