diff options
author | djm@openbsd.org <djm@openbsd.org> | 2016-06-23 05:17:51 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2016-06-24 13:35:28 +1000 |
commit | 46ecd19e554ccca15a7309cd1b6b44bc8e6b84af (patch) | |
tree | 4b38e61b1111fc411d50c3d89d042b665253d9d3 | |
parent | 3147e7595d0f2f842a666c844ac53e6c7a253d7e (diff) |
upstream commit
fix AuthenticationMethods during configuration re-parse;
reported by Juan Francisco Cantero Hurtado
Upstream-ID: 8ffa1dac25c7577eca8238e825317ab20848f9b4
-rw-r--r-- | servconf.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/servconf.c b/servconf.c index a411bfb6e..873b0d02a 100644 --- a/servconf.c +++ b/servconf.c | |||
@@ -1,5 +1,5 @@ | |||
1 | 1 | ||
2 | /* $OpenBSD: servconf.c,v 1.291 2016/06/17 05:03:40 djm Exp $ */ | 2 | /* $OpenBSD: servconf.c,v 1.292 2016/06/23 05:17:51 djm Exp $ */ |
3 | /* | 3 | /* |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
5 | * All rights reserved | 5 | * All rights reserved |
@@ -1813,6 +1813,7 @@ process_server_config_line(ServerOptions *options, char *line, | |||
1813 | case sAuthenticationMethods: | 1813 | case sAuthenticationMethods: |
1814 | if (options->num_auth_methods == 0) { | 1814 | if (options->num_auth_methods == 0) { |
1815 | value = 0; /* seen "any" pseudo-method */ | 1815 | value = 0; /* seen "any" pseudo-method */ |
1816 | value2 = 0; /* sucessfully parsed any method */ | ||
1816 | while ((arg = strdelim(&cp)) && *arg != '\0') { | 1817 | while ((arg = strdelim(&cp)) && *arg != '\0') { |
1817 | if (options->num_auth_methods >= | 1818 | if (options->num_auth_methods >= |
1818 | MAX_AUTH_METHODS) | 1819 | MAX_AUTH_METHODS) |
@@ -1836,12 +1837,13 @@ process_server_config_line(ServerOptions *options, char *line, | |||
1836 | "authentication method list.", | 1837 | "authentication method list.", |
1837 | filename, linenum); | 1838 | filename, linenum); |
1838 | } | 1839 | } |
1840 | value2 = 1; | ||
1839 | if (!*activep) | 1841 | if (!*activep) |
1840 | continue; | 1842 | continue; |
1841 | options->auth_methods[ | 1843 | options->auth_methods[ |
1842 | options->num_auth_methods++] = xstrdup(arg); | 1844 | options->num_auth_methods++] = xstrdup(arg); |
1843 | } | 1845 | } |
1844 | if (options->num_auth_methods == 0) { | 1846 | if (value2 == 0) { |
1845 | fatal("%s line %d: no AuthenticationMethods " | 1847 | fatal("%s line %d: no AuthenticationMethods " |
1846 | "specified", filename, linenum); | 1848 | "specified", filename, linenum); |
1847 | } | 1849 | } |