diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2014-10-26 12:38:38 -0400 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2014-10-26 12:38:38 -0400 |
commit | 915508d0d3989b8945a8dc54d585e4eb2aa0324a (patch) | |
tree | 6b623a37eb9ab33b07d7a789eccf785c5eb017fa /src/shared/mkdir-label.c | |
parent | 1040c8000f851b93ed77719752575f8b0c25a88a (diff) |
src/shared/mkdir-label.c: move and rename mkdir_label()
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/shared/mkdir-label.c')
-rw-r--r-- | src/shared/mkdir-label.c | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/src/shared/mkdir-label.c b/src/shared/mkdir-label.c index 832e3df4d9..95b4a9a1ed 100644 --- a/src/shared/mkdir-label.c +++ b/src/shared/mkdir-label.c @@ -30,27 +30,10 @@ #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_safe_label(const char *path, mode_t mode, uid_t uid, gid_t gid) { + 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); } |