[scponly] Break up the endless setup_chroot.sh problems on linux
Martin Werthmoeller
mw at werthmoeller.de
Sat Nov 8 17:48:56 EST 2003
Hi *,
I've tried fix the current setup_chroot.sh trouble on Linux systems. It
will work on my Debian Woody and my FreeBSD 4.6 machines.
The patch will fix the trouble with useradd and some noise about missing
libs when running. Here's the patch.
--- SNIP ---
--- setup_chroot.sh.in.org Sat Nov 8 16:23:01 2003
+++ setup_chroot.sh.in Sat Nov 8 16:50:38 2003
@@ -58,7 +58,7 @@
if [ x at PROG_USERADD@ = x ]; then
USE_PW=1;
else
- if [ x at PROG_PW@ = x ]; then
+ if [ x at PROG_USERADD@ = x ]; then
echo "this script requires the program useradd or pw to add your"
fail "chrooted scponly user."
fi
@@ -113,12 +113,16 @@
@INSTALL@ -d $targetdir/etc
for bin in $BINARIES; do
- @INSTALL@ -C $bin $targetdir$bin
+ @INSTALL@ $bin $targetdir$bin
done
LIB_LIST=`@PROG_LDD@ $BINARIES 2> /dev/null | @PROG_CUT@ -f2 -d\> | @PROG_CUT@ -f1 -d\( | @PROG_GREP@ "^ " | @PROG_SORT@ -u`
LDSOFOUND=0
+if [ -f /lib/ld.so ]; then
+ LIB_LIST="$LIB_LIST /lib/ld.so"
+ LDSOFOUND=1
+fi
if [ -f /usr/libexec/ld.so ]; then
LIB_LIST="$LIB_LIST /usr/libexec/ld.so"
LDSOFOUND=1
@@ -136,9 +140,9 @@
fail i cant find your equivalent of ld.so
fi
-/bin/ls /lib/libnss_compat* 2>&1 > /dev/null
+/bin/ls /lib/libnss_compat* > /dev/null 2>&1
if [ $? -eq 0 ]; then
- LIB_LIST="$LIB_LIST /lib/libnss_compat* /lib/ld.so"
+ LIB_LIST="$LIB_LIST /lib/libnss_compat*"
fi
if [ "x$LIB_LIST" != "x" ]; then
--- SNIP ---
Best Regards,
martin!
More information about the scponly
mailing list