summaryrefslogtreecommitdiffstats
path: root/src/shared/label-util.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 03:50:42 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 03:50:42 +0000
commit78e9bb837c258ac0ec7712b3d612cc2f407e731e (patch)
treef515d16b6efd858a9aeb5b0ef5d6f90bf288283d /src/shared/label-util.c
parentAdding debian version 255.5-1. (diff)
downloadsystemd-78e9bb837c258ac0ec7712b3d612cc2f407e731e.tar.xz
systemd-78e9bb837c258ac0ec7712b3d612cc2f407e731e.zip
Merging upstream version 256.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/shared/label-util.c')
-rw-r--r--src/shared/label-util.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/shared/label-util.c b/src/shared/label-util.c
index 308fbff..2c482da 100644
--- a/src/shared/label-util.c
+++ b/src/shared/label-util.c
@@ -81,22 +81,23 @@ int symlink_atomic_full_label(const char *from, const char *to, bool make_relati
return mac_smack_fix(to, 0);
}
-int mknod_label(const char *pathname, mode_t mode, dev_t dev) {
+int mknodat_label(int dirfd, const char *pathname, mode_t mode, dev_t dev) {
int r;
+ assert(dirfd >= 0 || dirfd == AT_FDCWD);
assert(pathname);
- r = mac_selinux_create_file_prepare(pathname, mode);
+ r = mac_selinux_create_file_prepare_at(dirfd, pathname, mode);
if (r < 0)
return r;
- r = RET_NERRNO(mknod(pathname, mode, dev));
+ r = RET_NERRNO(mknodat(dirfd, pathname, mode, dev));
mac_selinux_create_file_clear();
if (r < 0)
return r;
- return mac_smack_fix(pathname, 0);
+ return mac_smack_fix_full(dirfd, pathname, NULL, 0);
}
int btrfs_subvol_make_label(const char *path) {