From: Serge Hallyn Date: Tue, 27 Jan 2015 09:29:17 +0000 (+0100) Subject: fix busybox unpriv X-Git-Tag: lxc-1.1.0.rc4~12^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cfe615f031f0ea48d6f725f72c8109573828d0f6;p=thirdparty%2Flxc.git fix busybox unpriv 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 --- diff --git a/templates/lxc-busybox.in b/templates/lxc-busybox.in index ee54a7af2..3cfa9586a 100644 --- a/templates/lxc-busybox.in +++ b/templates/lxc-busybox.in @@ -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