diff options
author | Kay Sievers <kay@vrfy.org> | 2012-05-31 12:40:20 +0200 |
---|---|---|
committer | Kay Sievers <kay@vrfy.org> | 2012-05-31 12:40:20 +0200 |
commit | d2e54fae5ca7a0f71b5ac8b356a589ff0a09ea0a (patch) | |
tree | b1a4773022e0904f6e023bcff832d897ed46c893 /src/core | |
parent | 051d68786bd5bfe87e7cc0c1d68ec4be83eb662a (diff) |
mkdir: append _label to all mkdir() calls that explicitly set the selinux context
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/automount.c | 4 | ||||
-rw-r--r-- | src/core/dbus.c | 2 | ||||
-rw-r--r-- | src/core/manager.c | 2 | ||||
-rw-r--r-- | src/core/mount-setup.c | 6 | ||||
-rw-r--r-- | src/core/mount.c | 4 | ||||
-rw-r--r-- | src/core/path.c | 2 | ||||
-rw-r--r-- | src/core/shutdown.c | 2 | ||||
-rw-r--r-- | src/core/socket.c | 2 |
8 files changed, 12 insertions, 12 deletions
diff --git a/src/core/automount.c b/src/core/automount.c index e13259b388..64b6cff72e 100644 --- a/src/core/automount.c +++ b/src/core/automount.c @@ -499,7 +499,7 @@ static void automount_enter_waiting(Automount *a) { } /* We knowingly ignore the results of this call */ - mkdir_p(a->where, 0555); + mkdir_p_label(a->where, 0555); if (pipe2(p, O_NONBLOCK|O_CLOEXEC) < 0) { r = -errno; @@ -588,7 +588,7 @@ static void automount_enter_runnning(Automount *a) { return; } - mkdir_p(a->where, a->directory_mode); + mkdir_p_label(a->where, a->directory_mode); /* Before we do anything, let's see if somebody is playing games with us? */ if (lstat(a->where, &st) < 0) { diff --git a/src/core/dbus.c b/src/core/dbus.c index 434796456b..1bc83a2c2a 100644 --- a/src/core/dbus.c +++ b/src/core/dbus.c @@ -1095,7 +1095,7 @@ static int bus_init_private(Manager *m) { goto fail; } - mkdir_parents(p+10, 0755); + mkdir_parents_label(p+10, 0755); unlink(p+10); m->private_bus = dbus_server_listen(p, &error); free(p); diff --git a/src/core/manager.c b/src/core/manager.c index 5c6d63668d..dedcb74be6 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -2068,7 +2068,7 @@ static int create_generator_dir(Manager *m, char **generator, const char *name) return -ENOMEM; } - r = mkdir_p(p, 0755); + r = mkdir_p_label(p, 0755); if (r < 0) { log_error("Failed to create generator directory: %s", strerror(-r)); free(p); diff --git a/src/core/mount-setup.c b/src/core/mount-setup.c index 56ce2ae71a..c26dedca60 100644 --- a/src/core/mount-setup.c +++ b/src/core/mount-setup.c @@ -130,7 +130,7 @@ static int mount_one(const MountPoint *p, bool relabel) { /* The access mode here doesn't really matter too much, since * the mounted file system will take precedence anyway. */ - mkdir_p(p->where, 0755); + mkdir_p_label(p->where, 0755); log_debug("Mounting %s to %s of type %s with options %s.", p->what, @@ -404,8 +404,8 @@ int mount_setup(bool loaded_policy) { dev_setup(); /* Create a few directories we always want around */ - label_mkdir("/run/systemd", 0755); - label_mkdir("/run/systemd/system", 0755); + mkdir_label("/run/systemd", 0755); + mkdir_label("/run/systemd/system", 0755); return 0; } diff --git a/src/core/mount.c b/src/core/mount.c index 11ac692c6c..b885baab00 100644 --- a/src/core/mount.c +++ b/src/core/mount.c @@ -915,12 +915,12 @@ static void mount_enter_mounting(Mount *m) { m->control_command_id = MOUNT_EXEC_MOUNT; m->control_command = m->exec_command + MOUNT_EXEC_MOUNT; - mkdir_p(m->where, m->directory_mode); + mkdir_p_label(m->where, m->directory_mode); /* Create the source directory for bind-mounts if needed */ p = get_mount_parameters_fragment(m); if (p && mount_is_bind(p)) - mkdir_p(p->what, m->directory_mode); + mkdir_p_label(p->what, m->directory_mode); if (m->from_fragment) r = exec_command_set( diff --git a/src/core/path.c b/src/core/path.c index d6fedc736a..6cf03add44 100644 --- a/src/core/path.c +++ b/src/core/path.c @@ -215,7 +215,7 @@ static void path_spec_mkdir(PathSpec *s, mode_t mode) { if (s->type == PATH_EXISTS || s->type == PATH_EXISTS_GLOB) return; - if ((r = mkdir_p(s->path, mode)) < 0) + if ((r = mkdir_p_label(s->path, mode)) < 0) log_warning("mkdir(%s) failed: %s", s->path, strerror(-r)); } diff --git a/src/core/shutdown.c b/src/core/shutdown.c index a8dfe2614f..baef66dd9d 100644 --- a/src/core/shutdown.c +++ b/src/core/shutdown.c @@ -238,7 +238,7 @@ static int prepare_new_root(void) { } NULSTR_FOREACH(dir, dirs) - if (mkdir_p(dir, 0755) < 0 && errno != EEXIST) { + if (mkdir_p_label(dir, 0755) < 0 && errno != EEXIST) { log_error("Failed to mkdir %s: %m", dir); return -errno; } diff --git a/src/core/socket.c b/src/core/socket.c index df47578a49..633663e7e0 100644 --- a/src/core/socket.c +++ b/src/core/socket.c @@ -761,7 +761,7 @@ static int fifo_address_create( assert(path); assert(_fd); - mkdir_parents(path, directory_mode); + mkdir_parents_label(path, directory_mode); r = label_context_set(path, S_IFIFO); if (r < 0) |