summaryrefslogtreecommitdiffstats
path: root/src/basic/mkdir.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2021-11-12 15:44:50 +0100
committerLennart Poettering <lennart@poettering.net>2021-11-16 17:03:28 +0100
commit35cd0ba516fb0e2ee5744b9185f7df903962c726 (patch)
treeb2bd0411918b1c38b8b5997a6e5c17c2e5f3ddd8 /src/basic/mkdir.h
parentmkdir: drop mkdir_errno_wrapper(), use mkdirat_errno_wrapper() instead (diff)
downloadsystemd-35cd0ba516fb0e2ee5744b9185f7df903962c726.tar.xz
systemd-35cd0ba516fb0e2ee5744b9185f7df903962c726.zip
shared: clean up mkdir.h/label.h situation
Previously the mkdir_label() family of calls was implemented in src/shared/mkdir-label.c but its functions partly declared ins src/shared/label.h and partly in src/basic/mkdir.h (!!). That's weird (and wrong). Let's clean this up, and add a proper mkdir-label.h matching the .c file.
Diffstat (limited to 'src/basic/mkdir.h')
-rw-r--r--src/basic/mkdir.h11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/basic/mkdir.h b/src/basic/mkdir.h
index 837e493c6b..34a5227577 100644
--- a/src/basic/mkdir.h
+++ b/src/basic/mkdir.h
@@ -9,21 +9,16 @@ typedef enum MkdirFlags {
} MkdirFlags;
int mkdirat_errno_wrapper(int dirfd, const char *pathname, mode_t mode);
+
int mkdir_safe(const char *path, mode_t mode, uid_t uid, gid_t gid, MkdirFlags flags);
int mkdir_parents(const char *path, mode_t mode);
int mkdir_parents_safe(const char *prefix, const char *path, mode_t mode, uid_t uid, gid_t gid, MkdirFlags flags);
int mkdir_p(const char *path, mode_t mode);
int mkdir_p_safe(const char *prefix, const char *path, mode_t mode, uid_t uid, gid_t gid, MkdirFlags flags);
+int mkdir_p_root(const char *root, const char *p, uid_t uid, gid_t gid, mode_t m);
-/* mandatory access control(MAC) versions */
-int mkdir_safe_label(const char *path, mode_t mode, uid_t uid, gid_t gid, MkdirFlags flags);
-int mkdir_parents_label(const char *path, mode_t mod);
-int mkdir_p_label(const char *path, mode_t mode);
-
-/* internally used */
+/* The following are used to implement the mkdir_xyz_label() calls, don't use otherwise. */
typedef int (*mkdirat_func_t)(int dir_fd, const char *pathname, mode_t mode);
int mkdir_safe_internal(const char *path, mode_t mode, uid_t uid, gid_t gid, MkdirFlags flags, mkdirat_func_t _mkdir);
int mkdir_parents_internal(const char *prefix, const char *path, mode_t mode, uid_t uid, gid_t gid, MkdirFlags flags, mkdirat_func_t _mkdir);
int mkdir_p_internal(const char *prefix, const char *path, mode_t mode, uid_t uid, gid_t gid, MkdirFlags flags, mkdirat_func_t _mkdir);
-
-int mkdir_p_root(const char *root, const char *p, uid_t uid, gid_t gid, mode_t m);