summaryrefslogtreecommitdiff
path: root/src/shared/mkdir-label.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-10-23 19:58:45 +0200
committerLennart Poettering <lennart@poettering.net>2014-10-23 21:36:56 +0200
commitc34255bdb217c2a1d3ac6348252437ab8be9ca46 (patch)
treeb74ff09f1fa73b640fe53a50bc76a7bbbbf9a9bc /src/shared/mkdir-label.c
parentf3c80515c191b4447a2b0bc5a582dbffeca4679f (diff)
label: unify code to make directories, symlinks
Diffstat (limited to 'src/shared/mkdir-label.c')
-rw-r--r--src/shared/mkdir-label.c31
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);
}