summaryrefslogtreecommitdiff
path: root/src/shared/smack-util.h
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2022-12-22 14:28:27 +0100
committerDaan De Meyer <daan.j.demeyer@gmail.com>2023-02-20 12:45:43 +0100
commit9dcb8923ccfc1cfaac3a0ca6f2b632e1fca560ce (patch)
tree5dada3ec84a210243b6b65414819696b9ca8e8ef /src/shared/smack-util.h
parente8729892e88e7dacf52b39a8f859eb70d946b37e (diff)
downloadsystemd-9dcb8923ccfc1cfaac3a0ca6f2b632e1fca560ce.tar.gz
smack-util: Add renameat_and_apply_smack_floor_label()
Also add mac_smack_apply_at() as its a requirement for renameat_and_apply_smack_floor_label().
Diffstat (limited to 'src/shared/smack-util.h')
-rw-r--r--src/shared/smack-util.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/shared/smack-util.h b/src/shared/smack-util.h
index da8be5e6f0..17b31c6c25 100644
--- a/src/shared/smack-util.h
+++ b/src/shared/smack-util.h
@@ -38,9 +38,15 @@ const char* smack_attr_to_string(SmackAttr i) _const_;
SmackAttr smack_attr_from_string(const char *s) _pure_;
int mac_smack_read(const char *path, SmackAttr attr, char **label);
int mac_smack_read_fd(int fd, SmackAttr attr, char **label);
-int mac_smack_apply(const char *path, SmackAttr attr, const char *label);
+int mac_smack_apply_at(int dir_fd, const char *path, SmackAttr attr, const char *label);
+static inline int mac_smack_apply(const char *path, SmackAttr attr, const char *label) {
+ return mac_smack_apply_at(AT_FDCWD, path, attr, label);
+}
int mac_smack_apply_fd(int fd, SmackAttr attr, const char *label);
int mac_smack_apply_pid(pid_t pid, const char *label);
int mac_smack_copy(const char *dest, const char *src);
-int rename_and_apply_smack_floor_label(const char *temp_path, const char *dest_path);
+int renameat_and_apply_smack_floor_label(int fdf, const char *from, int fdt, const char *to);
+static inline int rename_and_apply_smack_floor_label(const char *from, const char *to) {
+ return renameat_and_apply_smack_floor_label(AT_FDCWD, from, AT_FDCWD, to);
+}