]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
fix busybox unpriv 420/head
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Tue, 27 Jan 2015 09:29:17 +0000 (10:29 +0100)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Tue, 27 Jan 2015 09:30:29 +0000 (10:30 +0100)
1. tty5 is not needed
2. the devices should be optional in case they didn't exist in the
host / parent-container
3. switch from 'touch $rootfs/dev/$dev' to using create=file in the
mount entry.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
templates/lxc-busybox.in

index ee54a7af27324a85249f170550a6f98f2392a95e..3cfa9586a1ec635abdb3a7d07bc122f0915997c3 100644 (file)
@@ -73,9 +73,8 @@ $rootfs/usr/lib64"
 
     # minimal devices needed for busybox
     if [ $in_userns -eq 1 ]; then
-        for dev in tty console tty0 tty1 tty5 ram0 null urandom; do
-            touch $rootfs/dev/$dev
-            echo "/dev/$dev dev/$dev    none bind 0 0" >> $path/fstab
+        for dev in tty console tty0 tty1 ram0 null urandom; do
+            echo "/dev/$dev dev/$dev    none bind,optional,create=file 0 0" >> $path/fstab
         done
     else
         mknod -m 666 tty c 5 0       || res=1