summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/sshd.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@cvs.openbsd.org>2017-11-03 03:18:54 +0000
committerDarren Tucker <dtucker@cvs.openbsd.org>2017-11-03 03:18:54 +0000
commita597fff09493e4e550bdc1ae5ff1b8069f6a754a (patch)
tree8d664f353599d757824abab300ee83a6a23063f3 /usr.bin/ssh/sshd.c
parent3dac79f18f32618c72c89e7b455b01cebf8e9171 (diff)
When doing a config test with sshd -T, only require the attributes
that are actually used in Match criteria rather than (an incomplete list of) all criteria. ok djm@, man page help jmc@
Diffstat (limited to 'usr.bin/ssh/sshd.c')
-rw-r--r--usr.bin/ssh/sshd.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/usr.bin/ssh/sshd.c b/usr.bin/ssh/sshd.c
index e3a86d69421..b00c9ccb090 100644
--- a/usr.bin/ssh/sshd.c
+++ b/usr.bin/ssh/sshd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshd.c,v 1.497 2017/10/27 00:18:41 djm Exp $ */
+/* $OpenBSD: sshd.c,v 1.498 2017/11/03 03:18:53 dtucker Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1338,7 +1338,7 @@ main(int ac, char **av)
struct sshkey *pubkey;
int keytype;
Authctxt *authctxt;
- struct connection_info *connection_info = get_connection_info(0, 0);
+ struct connection_info *connection_info = NULL;
ssh_malloc_init(); /* must be called before any mallocs */
/* Save argv. */
@@ -1435,6 +1435,7 @@ main(int ac, char **av)
test_flag = 2;
break;
case 'C':
+ connection_info = get_connection_info(0, 0);
if (parse_server_match_testspec(connection_info,
optarg) == -1)
exit(1);
@@ -1489,14 +1490,10 @@ main(int ac, char **av)
sensitive_data.have_ssh2_key = 0;
/*
- * If we're doing an extended config test, make sure we have all of
- * the parameters we need. If we're not doing an extended test,
- * do not silently ignore connection test params.
+ * If we're not doing an extended test do not silently ignore connection
+ * test params.
*/
- if (test_flag >= 2 && server_match_spec_complete(connection_info) == 0)
- fatal("user, host and addr are all required when testing "
- "Match configs");
- if (test_flag < 2 && server_match_spec_complete(connection_info) >= 0)
+ if (test_flag < 2 && connection_info != NULL)
fatal("Config test connection parameter (-C) provided without "
"test mode (-T)");
@@ -1682,8 +1679,7 @@ main(int ac, char **av)
}
if (test_flag > 1) {
- if (server_match_spec_complete(connection_info) == 1)
- parse_server_match_config(&options, connection_info);
+ parse_server_match_config(&options, connection_info);
dump_config(&options);
}