]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/basic/mkdir-label.c
1d51e92e9af1e52420ac76d77d647ea3b87136a0
1 /* SPDX-License-Identifier: LGPL-2.1+ */
11 #include "selinux-util.h"
12 #include "smack-util.h"
14 int mkdir_label(const char *path
, mode_t mode
) {
19 r
= mac_selinux_create_file_prepare(path
, S_IFDIR
);
23 r
= mkdir_errno_wrapper(path
, mode
);
24 mac_selinux_create_file_clear();
28 return mac_smack_fix(path
, 0);
31 int mkdir_safe_label(const char *path
, mode_t mode
, uid_t uid
, gid_t gid
, MkdirFlags flags
) {
32 return mkdir_safe_internal(path
, mode
, uid
, gid
, flags
, mkdir_label
);
35 int mkdir_parents_label(const char *path
, mode_t mode
) {
36 return mkdir_parents_internal(NULL
, path
, mode
, mkdir_label
);
39 int mkdir_p_label(const char *path
, mode_t mode
) {
40 return mkdir_p_internal(NULL
, path
, mode
, mkdir_label
);