blob: f32540f10db1c094247f49c3d5c09e5b529fa445 [file] [log] [blame] [raw]
#!/bin/sh
export SHELL=/bin/sh
LOG_FILE="/var/log/noshell/$USER.`date -u +%F.%H-%M-%S`"
[ -d /tmp/playground ] || mkdir /tmp/playground
cd /tmp/playground
export HOME=/tmp/playground
if [ "$1" = -t ] || { [ ! -f /etc/rshrc ] && [ ! -x /usr/games/dungeon ]; }; then
exec script -c "export SHELL=/usr/bin/telnet; exec /usr/bin/telnet" -fqt $LOG_FILE 2> $LOG_FILE.time
fi
if [ -f /etc/rshrc ]; then
UESLESS_SHELL="/bin/bash --restricted --noprofile --rcfile /etc/rshrc"
else
UESLESS_SHELL="/usr/games/dungeon"
fi
exec script -c "export SHELL=/bin/noshellhere; export PATH=/dev/pts; exec $UESLESS_SHELL" -fqt $LOG_FILE 2> $LOG_FILE.time