X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fcore%2Fnamespace.c;h=4b8dbdd0d83d975a2e5f135d280d05f056047f98;hp=a2025459f1447823ed0fe3f43208e9720d345280;hb=4968105790c65af58d4ab42bffa2a4bedc0be8ee;hpb=b77acbcf7d9070ac01333a1b98c6222bee599550 diff --git a/src/core/namespace.c b/src/core/namespace.c index a2025459f..4b8dbdd0d 100644 --- a/src/core/namespace.c +++ b/src/core/namespace.c @@ -35,7 +35,6 @@ #include "strv.h" #include "util.h" #include "path-util.h" -#include "namespace.h" #include "missing.h" #include "execute.h" #include "loopback-setup.h" @@ -43,6 +42,8 @@ #include "dev-setup.h" #include "def.h" #include "label.h" +#include "selinux-util.h" +#include "namespace.h" typedef enum MountMode { /* This is ordered by priority! */ @@ -276,10 +277,8 @@ static int mount_kdbus(BindMount *m) { u = umask(0000); - if (!mkdtemp(temporary_mount)) { - log_error("Failed create temp dir: %m"); - return -errno; - } + if (!mkdtemp(temporary_mount)) + return log_error_errno(errno, "Failed create temp dir: %m"); root = strappenda(temporary_mount, "/kdbus"); (void)mkdir(root, 0755); @@ -291,21 +290,21 @@ static int mount_kdbus(BindMount *m) { /* create a new /dev/null dev node copy so we have some fodder to * bind-mount the custom endpoint over. */ if (stat("/dev/null", &st) < 0) { - log_error("Failed to stat /dev/null: %m"); + log_error_errno(errno, "Failed to stat /dev/null: %m"); r = -errno; goto fail; } busnode = strappenda(root, "/bus"); if (mknod(busnode, (st.st_mode & ~07777) | 0600, st.st_rdev) < 0) { - log_error("mknod() for %s failed: %m", busnode); + log_error_errno(errno, "mknod() for %s failed: %m", busnode); r = -errno; goto fail; } r = mount(m->path, busnode, "bind", MS_BIND, NULL); if (r < 0) { - log_error("bind mount of %s failed: %m", m->path); + log_error_errno(errno, "bind mount of %s failed: %m", m->path); r = -errno; goto fail; } @@ -317,7 +316,7 @@ static int mount_kdbus(BindMount *m) { } if (mount(root, basepath, NULL, MS_MOVE, NULL) < 0) { - log_error("bind mount of %s failed: %m", basepath); + log_error_errno(errno, "bind mount of %s failed: %m", basepath); r = -errno; goto fail; } @@ -423,7 +422,7 @@ int setup_namespace( bool private_dev, ProtectHome protect_home, ProtectSystem protect_system, - unsigned mount_flags) { + unsigned long mount_flags) { BindMount *m, *mounts = NULL; unsigned n;