/usr/sbin/globus-gridftp-server-setup-chroot is in globus-gridftp-server-progs 6.38-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | #!/bin/sh
USAGE="Usage: $0 [-c <certificates dir>] -r <chroot path to create>"
CERT_DIR=/etc/grid-security/certificates
COPYFILES="/etc/passwd
/etc/group
/etc/hosts
/etc/nsswitch.conf"
if [ $(id -ru) -ne 0 ]; then
echo "This command must be run as 'root'."
exit 1
fi
while getopts "c:r:" opt; do
case $opt in
c ) CERT_DIR=$OPTARG;;
r ) ROOT_DIR=$OPTARG;;
* ) echo $USAGE; exit 1;;
esac
done
if [ -z "$ROOT_DIR" -o "$ROOT_DIR" -ef "/" ]; then
echo "Invalid root path: $ROOT_DIR."
echo $USAGE
exit 1
fi
mkdir -p $ROOT_DIR
if [ ! -d "$ROOT_DIR" ]; then
exit 1;
fi
chown root.root $ROOT_DIR
chmod 755 $ROOT_DIR
mkdir $ROOT_DIR/tmp 2>/dev/null
chmod 1777 $ROOT_DIR/tmp
mkdir $ROOT_DIR/dev 2>/dev/null
if [ -x /dev/MAKEDEV ]; then
/dev/MAKEDEV -d $ROOT_DIR/dev -x zero null random urandom
elif [ -x /sbin/MAKEDEV ]; then
/sbin/MAKEDEV -d $ROOT_DIR/dev -x zero null random urandom
fi
if [ ! -e /dev/null ]; then
echo "Could not create /dev devices."
exit 1
fi
mkdir -p $ROOT_DIR/etc/grid-security/certificates
cp -LpR $CERT_DIR/* $ROOT_DIR/etc/grid-security/certificates/
for file in $COPYFILES; do
cp --parents -Lp $file $ROOT_DIR
done
echo ""
echo "Finished setting up a chroot dir at $ROOT_DIR."
echo ""
echo "You may wish to create data directories or use"
echo " mount --bind datadir $ROOT_DIR/datadir"
echo "to link in external directories."
echo ""
|