Package: scponly Version: 4.6-1.3 Severity: important Tags: patch
The sample script included in /usr/share/doc/scponly/setup_chroot/setup_chroot.sh.gz does not work correctly on x86_64 hosts. The reason is that x86_64 hosts require additional library files to be copied to the chrooted environment. Additionaly, as #551868 reports, a /dev/null file is also required for the chrooted environment (this is not x86_64 specific). I have modified the script so that the produced environment works. Patch attached. (kudos to quae.co.uk folks for the instructions http://www.quae.co.uk/2009/03/03/scponly-chroot-with-ubuntu-hardy-64-bit :) -- System Information: Debian Release: 5.0.3 APT prefers stable APT policy: (500, 'stable') Architecture: amd64 (x86_64) Kernel: Linux 2.6.26-2-amd64 (SMP w/8 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash Versions of packages scponly depends on: ii debconf [debconf-2.0] 1.5.24 Debian configuration management sy ii libc6 2.7-18 GNU C Library: Shared libraries ii openssh-server 1:5.1p1-5 secure shell server, an rshd repla ii passwd 1:4.1.1-6 change and administer password and scponly recommends no packages. scponly suggests no packages. -- debconf information: * scponly/chroot: true
--- setup_chroot.sh 2009-11-17 17:19:14.501417000 +0200 +++ setup_chroot2.sh 2009-11-17 17:17:48.195152649 +0200 @@ -78,8 +78,12 @@ # # we also need to add some form of ld.so, here are some good guesses. +# for 64 bit linux we need extra stuff. see http://www.quae.co.uk/2009/03/03/scponly-chroot-with-ubuntu-hardy-64-bit # -LDSO_LIST="/lib/ld.so /libexec/ld-elf.so /libexec/ld-elf.so.1 /usr/libexec/ld.so /lib/ld-linux.so.2 /usr/libexec/ld-elf.so.1" +LDSO_LIST="/lib/ld-2.7.so /lib/ld.so /libexec/ld-elf.so /libexec/ld-elf.so.1 /usr/libexec/ld.so /lib/ld-linux.so.2 /usr/libexec/ld-elf.so.1" +if [ x`uname -m` = "xx86_64" ]; then + LDSO_LIST="$LDSO_LIST /lib/libncurses.so.5 /lib/libdl.so.2 /lib/libc.so.6 /lib64/ld-linux-x86-64.so.2" +fi for lib in $LDSO_LIST; do if [ -f $lib ]; then LDSOFOUND=1; @@ -199,6 +203,10 @@ done fi +# and a /dev/null +[ -d $targetdir/dev ] || mkdir $targetdir/dev +mknod -m 666 $targetdir/dev/null c 1 3 + if [ "x$USE_PW" = x0 ] ; then /usr/sbin/useradd -d "$targetdir" -s "/usr/sbin/scponlyc" $targetuser if [ $? -ne 0 ]; then