upstream: make this use ssh_proxy rather than starting/stopping a

daemon for each testcase

OpenBSD-Regress-ID: 608b7655ea65b1ba8fff5a13ce9caa60ef0c8166
This commit is contained in:
djm@openbsd.org 2018-07-13 02:13:50 +00:00 committed by Damien Miller
parent dbab02f920
commit 7449c178e9
1 changed files with 8 additions and 4 deletions

View File

@ -1,6 +1,6 @@
# Public Domain # Public Domain
# Zev Weiss, 2016 # Zev Weiss, 2016
# $OpenBSD: allow-deny-users.sh,v 1.4 2017/10/20 02:13:41 djm Exp $ # $OpenBSD: allow-deny-users.sh,v 1.5 2018/07/13 02:13:50 djm Exp $
tid="AllowUsers/DenyUsers" tid="AllowUsers/DenyUsers"
@ -10,6 +10,8 @@ if [ "x$me" = "x" ]; then
fi fi
other="nobody" other="nobody"
cp $OBJ/sshd_proxy $OBJ/sshd_proxy.orig
test_auth() test_auth()
{ {
deny="$1" deny="$1"
@ -17,17 +19,19 @@ test_auth()
should_succeed="$3" should_succeed="$3"
failmsg="$4" failmsg="$4"
cp $OBJ/sshd_proxy.orig $OBJ/sshd_proxy
echo DenyUsers="$deny" >> $OBJ/sshd_proxy
echo AllowUsers="$allow" >> $OBJ/sshd_proxy
start_sshd -oDenyUsers="$deny" -oAllowUsers="$allow" start_sshd -oDenyUsers="$deny" -oAllowUsers="$allow"
${SSH} -F $OBJ/ssh_config "$me@somehost" true ${SSH} -F $OBJ/ssh_proxy "$me@somehost" true
status=$? status=$?
if (test $status -eq 0 && ! $should_succeed) \ if (test $status -eq 0 && ! $should_succeed) \
|| (test $status -ne 0 && $should_succeed); then || (test $status -ne 0 && $should_succeed); then
fail "$failmsg" fail "$failmsg"
fi fi
stop_sshd
} }
# DenyUsers AllowUsers should_succeed failure_message # DenyUsers AllowUsers should_succeed failure_message