Skip to content

Commit 07e9fec

Browse files
committed
Better isolate new chroot from host /dev, /dev/pts, /run/udev
Closes: #1108311 Thanks: Wolfgang Zarre <lxdev12@zirdeon.com>
1 parent eae9181 commit 07e9fec

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

grml-debootstrap

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1814,12 +1814,6 @@ iface ${interface} inet dhcp
18141814
bailout 1
18151815
fi
18161816
fi
1817-
1818-
if [ -d /run/udev ] ; then
1819-
einfo "Setting up bind-mount /run/udev"
1820-
mkdir -p "${MNTPOINT}"/run/udev
1821-
mount --bind /run/udev "${MNTPOINT}"/run/udev
1822-
fi
18231817
}
18241818
# }}}
18251819

@@ -1879,8 +1873,8 @@ chrootscript() {
18791873
eend 1
18801874
else
18811875
einfo "Executing chroot-script now"
1882-
mount -t devtmpfs udev "${MNTPOINT}"/dev
1883-
mount -t devpts devpts "${MNTPOINT}"/dev/pts
1876+
mount -o bind,ro /dev "${MNTPOINT}"/dev
1877+
mount -t devpts -o newinstance devpts "${MNTPOINT}"/dev/pts
18841878
if [ "$DEBUG" = "true" ] ; then
18851879
clean_chroot "$MNTPOINT" /bin/bash -x /bin/chroot-script
18861880
else

0 commit comments

Comments
 (0)