diff options
Diffstat (limited to 'src/shared/mkdir-label.c')
-rw-r--r-- | src/shared/mkdir-label.c | 31 |
1 files changed, 3 insertions, 28 deletions
diff --git a/src/shared/mkdir-label.c b/src/shared/mkdir-label.c index 8b35386706..ee11ac06ff 100644 --- a/src/shared/mkdir-label.c +++ b/src/shared/mkdir-label.c @@ -32,39 +32,14 @@ #include "path-util.h" #include "mkdir.h" -static int label_mkdir(const char *path, mode_t mode) { - int r; - - if (mac_selinux_use()) - return mac_selinux_mkdir(path, mode); - - if (mac_smack_use()) { - r = mkdir(path, mode); - if (r < 0) - return -errno; - - return mac_smack_fix(path, false, false); - } - - r = mkdir(path, mode); - if (r < 0) - return -errno; - - return 0; -} - -int mkdir_label(const char *path, mode_t mode) { - return label_mkdir(path, mode); -} - int mkdir_safe_label(const char *path, mode_t mode, uid_t uid, gid_t gid) { - return mkdir_safe_internal(path, mode, uid, gid, label_mkdir); + return mkdir_safe_internal(path, mode, uid, gid, mkdir_label); } int mkdir_parents_label(const char *path, mode_t mode) { - return mkdir_parents_internal(NULL, path, mode, label_mkdir); + return mkdir_parents_internal(NULL, path, mode, mkdir_label); } int mkdir_p_label(const char *path, mode_t mode) { - return mkdir_p_internal(NULL, path, mode, label_mkdir); + return mkdir_p_internal(NULL, path, mode, mkdir_label); } |