[systemd-commits] 2 commits - src/core src/initctl

Lennart Poettering lennart at kemper.freedesktop.org
Wed Jun 4 08:27:16 PDT 2014


 src/core/namespace.c  |    8 +++++++-
 src/initctl/initctl.c |    3 ++-
 2 files changed, 9 insertions(+), 2 deletions(-)

New commits:
commit e06b6479a5dc471412f3a00f4a3d6bd5edb8904c
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Jun 4 17:21:18 2014 +0200

    core: provide /dev/ptmx as symlink in PrivateDevices= execution environments

diff --git a/src/core/namespace.c b/src/core/namespace.c
index 1654004..1f987a4 100644
--- a/src/core/namespace.c
+++ b/src/core/namespace.c
@@ -143,7 +143,7 @@ static int mount_dev(BindMount *m) {
                 "/dev/tty\0";
 
         char temporary_mount[] = "/tmp/namespace-dev-XXXXXX";
-        const char *d, *dev = NULL, *devpts = NULL, *devshm = NULL, *devkdbus = NULL, *devhugepages = NULL, *devmqueue = NULL, *devlog = NULL;
+        const char *d, *dev = NULL, *devpts = NULL, *devshm = NULL, *devkdbus = NULL, *devhugepages = NULL, *devmqueue = NULL, *devlog = NULL, *devptmx = NULL;
         _cleanup_umask_ mode_t u;
         int r;
 
@@ -168,6 +168,9 @@ static int mount_dev(BindMount *m) {
                 goto fail;
         }
 
+        devptmx = strappenda(temporary_mount, "/dev/ptmx");
+        symlink("pts/ptmx", devptmx);
+
         devshm = strappenda(temporary_mount, "/dev/shm");
         mkdir(devshm, 01777);
         r = mount("/dev/shm", devshm, NULL, MS_BIND, NULL);

commit 82d252404a7ee6bd5f24482a0b50a8e91aa93257
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Jun 4 16:59:13 2014 +0200

    core: make sure PrivateDevices= makes /dev/log available
    
    Now that we moved the actual syslog socket to
    /run/systemd/journal/dev-log we can actually make /dev/log a symlink to
    it, when PrivateDevices= is used, thus making syslog available to
    services using PrivateDevices=.

diff --git a/src/core/namespace.c b/src/core/namespace.c
index de09e9f..1654004 100644
--- a/src/core/namespace.c
+++ b/src/core/namespace.c
@@ -143,7 +143,7 @@ static int mount_dev(BindMount *m) {
                 "/dev/tty\0";
 
         char temporary_mount[] = "/tmp/namespace-dev-XXXXXX";
-        const char *d, *dev = NULL, *devpts = NULL, *devshm = NULL, *devkdbus = NULL, *devhugepages = NULL, *devmqueue = NULL;
+        const char *d, *dev = NULL, *devpts = NULL, *devshm = NULL, *devkdbus = NULL, *devhugepages = NULL, *devmqueue = NULL, *devlog = NULL;
         _cleanup_umask_ mode_t u;
         int r;
 
@@ -188,6 +188,9 @@ static int mount_dev(BindMount *m) {
         mkdir(devhugepages, 0755);
         mount("/dev/hugepages", devhugepages, NULL, MS_BIND, NULL);
 
+        devlog = strappenda(temporary_mount, "/dev/log");
+        symlink("/run/systemd/journal/dev-log", devlog);
+
         NULSTR_FOREACH(d, devnodes) {
                 _cleanup_free_ char *dn = NULL;
                 struct stat st;
diff --git a/src/initctl/initctl.c b/src/initctl/initctl.c
index f9a6ed4..f3f6f73 100644
--- a/src/initctl/initctl.c
+++ b/src/initctl/initctl.c
@@ -383,7 +383,8 @@ int main(int argc, char *argv[]) {
 
         umask(0022);
 
-        if ((n = sd_listen_fds(true)) < 0) {
+        n = sd_listen_fds(true);
+        if (n < 0) {
                 log_error("Failed to read listening file descriptors from environment: %s", strerror(-r));
                 return EXIT_FAILURE;
         }



More information about the systemd-commits mailing list