diff options
author | djm@openbsd.org <djm@openbsd.org> | 2018-07-13 02:13:50 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2018-07-13 12:14:38 +1000 |
commit | 7449c178e943e5c4f6c8416a4e41d93b70c11c9e (patch) | |
tree | b7504ce184e389f40a81f70f4274d682bbd059c9 | |
parent | dbab02f9208d9baa134cec1d007054ec82b96ca9 (diff) |
upstream: make this use ssh_proxy rather than starting/stopping a
daemon for each testcase
OpenBSD-Regress-ID: 608b7655ea65b1ba8fff5a13ce9caa60ef0c8166
-rw-r--r-- | regress/allow-deny-users.sh | 12 |
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 | ||
5 | tid="AllowUsers/DenyUsers" | 5 | tid="AllowUsers/DenyUsers" |
6 | 6 | ||
@@ -10,6 +10,8 @@ if [ "x$me" = "x" ]; then | |||
10 | fi | 10 | fi |
11 | other="nobody" | 11 | other="nobody" |
12 | 12 | ||
13 | cp $OBJ/sshd_proxy $OBJ/sshd_proxy.orig | ||
14 | |||
13 | test_auth() | 15 | test_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 |