summaryrefslogtreecommitdiff
path: root/regress/allow-deny-users.sh
diff options
context:
space:
mode:
Diffstat (limited to 'regress/allow-deny-users.sh')
-rw-r--r--regress/allow-deny-users.sh12
1 files changed, 8 insertions, 4 deletions
diff --git a/regress/allow-deny-users.sh b/regress/allow-deny-users.sh
index 4165111e0..5c3895122 100644
--- a/regress/allow-deny-users.sh
+++ b/regress/allow-deny-users.sh
@@ -1,6 +1,6 @@
1# Public Domain 1# Public Domain
2# Zev Weiss, 2016 2# Zev Weiss, 2016
3# $OpenBSD: allow-deny-users.sh,v 1.4 2017/10/20 02:13:41 djm Exp $ 3# $OpenBSD: allow-deny-users.sh,v 1.5 2018/07/13 02:13:50 djm Exp $
4 4
5tid="AllowUsers/DenyUsers" 5tid="AllowUsers/DenyUsers"
6 6
@@ -10,6 +10,8 @@ if [ "x$me" = "x" ]; then
10fi 10fi
11other="nobody" 11other="nobody"
12 12
13cp $OBJ/sshd_proxy $OBJ/sshd_proxy.orig
14
13test_auth() 15test_auth()
14{ 16{
15 deny="$1" 17 deny="$1"
@@ -17,17 +19,19 @@ test_auth()
17 should_succeed="$3" 19 should_succeed="$3"
18 failmsg="$4" 20 failmsg="$4"
19 21
22 cp $OBJ/sshd_proxy.orig $OBJ/sshd_proxy
23 echo DenyUsers="$deny" >> $OBJ/sshd_proxy
24 echo AllowUsers="$allow" >> $OBJ/sshd_proxy
25
20 start_sshd -oDenyUsers="$deny" -oAllowUsers="$allow" 26 start_sshd -oDenyUsers="$deny" -oAllowUsers="$allow"
21 27
22 ${SSH} -F $OBJ/ssh_config "$me@somehost" true 28 ${SSH} -F $OBJ/ssh_proxy "$me@somehost" true
23 status=$? 29 status=$?
24 30
25 if (test $status -eq 0 && ! $should_succeed) \ 31 if (test $status -eq 0 && ! $should_succeed) \
26 || (test $status -ne 0 && $should_succeed); then 32 || (test $status -ne 0 && $should_succeed); then
27 fail "$failmsg" 33 fail "$failmsg"
28 fi 34 fi
29
30 stop_sshd
31} 35}
32 36
33# DenyUsers AllowUsers should_succeed failure_message 37# DenyUsers AllowUsers should_succeed failure_message