Source: schroot
Version: 1.6.10-2
Tags: patch
Severity: minor

Hi,

Once upon a time I found a chroot that didn't have a /bin/sh and
schroot failed miserably due to a call to binfmt --find on a
non-existing file...
Attached patch makes 15binfmt test for $shell to be readable.

Cheers,
-- 
Raphael Geissert - Debian Developer
www.debian.org - get.debian.net
Index: sources-schroot/1.6.10-2/etc/setup.d/15binfmt
===================================================================
--- sources-schroot/1.6.10-2/etc/setup.d/15binfmt
+++ sources-schroot/1.6.10-2/etc/setup.d/15binfmt
@@ -34,8 +34,12 @@
 fi
 
 shell="${CHROOT_PATH}/bin/sh"
 
+if ! [ -r "$shell" ]; then
+    exit 0
+fi
+
 for emulator in $(update-binfmts --find "$shell"); do
     dst="${CHROOT_PATH}$emulator"
     if [ ! -e "$emulator" ]; then
         info "Missing emulator: $emulator; not enabling binfmt support"

Reply via email to