]>
Commit | Line | Data |
---|---|---|
f4ef809c | 1 | #pragma once |
49e942b2 KS |
2 | |
3 | /*** | |
4 | This file is part of systemd. | |
5 | ||
6 | Copyright 2010 Lennart Poettering | |
39bdfa31 | 7 | Copyright 2013 Kay Sievers |
49e942b2 KS |
8 | |
9 | systemd is free software; you can redistribute it and/or modify it | |
5430f7f2 LP |
10 | under the terms of the GNU Lesser General Public License as published by |
11 | the Free Software Foundation; either version 2.1 of the License, or | |
49e942b2 KS |
12 | (at your option) any later version. |
13 | ||
14 | systemd is distributed in the hope that it will be useful, but | |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
5430f7f2 | 17 | Lesser General Public License for more details. |
49e942b2 | 18 | |
5430f7f2 | 19 | You should have received a copy of the GNU Lesser General Public License |
49e942b2 KS |
20 | along with systemd; If not, see <http://www.gnu.org/licenses/>. |
21 | ***/ | |
22 | ||
4ad49000 LP |
23 | #include <sys/types.h> |
24 | ||
c66e7f04 | 25 | int mkdir_safe(const char *path, mode_t mode, uid_t uid, gid_t gid); |
c66e7f04 | 26 | int mkdir_parents(const char *path, mode_t mode); |
c66e7f04 | 27 | int mkdir_p(const char *path, mode_t mode); |
4ad49000 | 28 | |
66b6d9d5 | 29 | /* mandatory access control(MAC) versions */ |
39bdfa31 KS |
30 | int mkdir_safe_label(const char *path, mode_t mode, uid_t uid, gid_t gid); |
31 | int mkdir_parents_label(const char *path, mode_t mode); | |
32 | int mkdir_p_label(const char *path, mode_t mode); | |
39bdfa31 KS |
33 | |
34 | /* internally used */ | |
35 | typedef int (*mkdir_func_t)(const char *pathname, mode_t mode); | |
36 | int mkdir_safe_internal(const char *path, mode_t mode, uid_t uid, gid_t gid, mkdir_func_t _mkdir); | |
37 | int mkdir_parents_internal(const char *prefix, const char *path, mode_t mode, mkdir_func_t _mkdir); | |
38 | int mkdir_p_internal(const char *prefix, const char *path, mode_t mode, mkdir_func_t _mkdir); |