diff options
author | djm@openbsd.org@openbsd.org <djm@openbsd.org@openbsd.org> | 2017-11-14 00:45:29 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2017-11-14 11:46:38 +1100 |
commit | 548d3a66feb64c405733932a6b1abeaf7198fa71 (patch) | |
tree | dd129abc044058b8532afde963a7e8a62414fc85 /sshd.c | |
parent | 33edb6ebdc2f81ebed1bceadacdfb8910b64fb88 (diff) |
upstream commit
fix problem in configuration parsing when in config dump mode
(sshd -T) without providing a full connection specification (sshd -T -C ...)
spotted by bluhm@
OpenBSD-Commit-ID: 7125faf5740eaa9d3a2f25400a0bc85e94e28b8f
Diffstat (limited to 'sshd.c')
-rw-r--r-- | sshd.c | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sshd.c,v 1.498 2017/11/03 03:18:53 dtucker Exp $ */ | 1 | /* $OpenBSD: sshd.c,v 1.499 2017/11/14 00:45:29 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -144,7 +144,12 @@ char *config_file_name = _PATH_SERVER_CONFIG_FILE; | |||
144 | */ | 144 | */ |
145 | int debug_flag = 0; | 145 | int debug_flag = 0; |
146 | 146 | ||
147 | /* Flag indicating that the daemon should only test the configuration and keys. */ | 147 | /* |
148 | * Indicating that the daemon should only test the configuration and keys. | ||
149 | * If test_flag > 1 ("-T" flag), then sshd will also dump the effective | ||
150 | * configuration, optionally using connection information provided by the | ||
151 | * "-C" flag. | ||
152 | */ | ||
148 | int test_flag = 0; | 153 | int test_flag = 0; |
149 | 154 | ||
150 | /* Flag indicating that the daemon is being started from inetd. */ | 155 | /* Flag indicating that the daemon is being started from inetd. */ |
@@ -1824,6 +1829,12 @@ main(int ac, char **av) | |||
1824 | } | 1829 | } |
1825 | 1830 | ||
1826 | if (test_flag > 1) { | 1831 | if (test_flag > 1) { |
1832 | /* | ||
1833 | * If no connection info was provided by -C then use | ||
1834 | * use a blank one that will cause no predicate to match. | ||
1835 | */ | ||
1836 | if (connection_info == NULL) | ||
1837 | connection_info = get_connection_info(0, 0); | ||
1827 | parse_server_match_config(&options, connection_info); | 1838 | parse_server_match_config(&options, connection_info); |
1828 | dump_config(&options); | 1839 | dump_config(&options); |
1829 | } | 1840 | } |