chiark / gitweb /
core: provide /dev/ptmx as symlink in PrivateDevices= execution environments
authorLennart Poettering <lennart@poettering.net>
Wed, 4 Jun 2014 15:21:18 +0000 (17:21 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 4 Jun 2014 15:21:18 +0000 (17:21 +0200)
src/core/namespace.c

index 1654004..1f987a4 100644 (file)
@@ -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);