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
+7 -2
View File
@@ -48,9 +48,14 @@ static inline int symlink_idempotent(const char *from, const char *to, bool make
return symlinkat_idempotent(from, AT_FDCWD, to, make_relative);
}
int symlinkat_atomic_full(const char *from, int atfd, const char *to, bool make_relative);
typedef enum SymlinkFlags {
SYMLINK_MAKE_RELATIVE = 1 << 0,
SYMLINK_LABEL = 1 << 1,
} SymlinkFlags;
int symlinkat_atomic_full(const char *from, int atfd, const char *to, SymlinkFlags flags);
static inline int symlink_atomic(const char *from, const char *to) {
return symlinkat_atomic_full(from, AT_FDCWD, to, false);
return symlinkat_atomic_full(from, AT_FDCWD, to, 0);
}
int mknodat_atomic(int atfd, const char *path, mode_t mode, dev_t dev);