Bugzilla – Attachment 2836 Details for
Bug 2398
AuthenticationMethods doesn't have default value (inconsistency) and it accept empty value
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
clear AuthenticationMethods=any in fill_default_server_options()
bz2398.diff (text/plain), 2.01 KB, created by
Damien Miller
on 2016-06-17 14:42:46 AEST
(
hide
)
Description:
clear AuthenticationMethods=any in fill_default_server_options()
Filename:
MIME Type:
Creator:
Damien Miller
Created:
2016-06-17 14:42:46 AEST
Size:
2.01 KB
patch
obsolete
>diff --git a/servconf.c b/servconf.c >index 527f54d..5914de6 100644 >--- a/servconf.c >+++ b/servconf.c >@@ -363,6 +363,15 @@ fill_default_server_options(ServerOptions *options) > for (i = 0; i < options->num_host_cert_files; i++) > CLEAR_ON_NONE(options->host_cert_files[i]); > #undef CLEAR_ON_NONE >+ >+ /* Similar handling for AuthenticationMethods=any */ >+ if (options->num_auth_methods == 1 && >+ strcmp(options->auth_methods[0], "any") == 0) { >+ free(options->auth_methods[0]); >+ options->auth_methods[0] = NULL; >+ options->num_auth_methods = 0; >+ } >+ > } > > /* Keyword tokens. */ >@@ -1752,16 +1761,30 @@ process_server_config_line(ServerOptions *options, char *line, > > case sAuthenticationMethods: > if (options->num_auth_methods == 0) { >+ value = 0; /* seen "any" pseudo-method */ > while ((arg = strdelim(&cp)) && *arg != '\0') { > if (options->num_auth_methods >= > MAX_AUTH_METHODS) > fatal("%s line %d: " > "too many authentication methods.", > filename, linenum); >- if (auth2_methods_valid(arg, 0) != 0) >+ if (strcmp(arg, "any") == 0) { >+ if (options->num_auth_methods > 0) { >+ fatal("%s line %d: \"any\" " >+ "must appear alone in " >+ "AuthenticationMethods", >+ filename, linenum); >+ } >+ value = 1; >+ } else if (value) { >+ fatal("%s line %d: \"any\" must appear " >+ "alone in AuthenticationMethods", >+ filename, linenum); >+ } else if (auth2_methods_valid(arg, 0) != 0) { > fatal("%s line %d: invalid " > "authentication method list.", > filename, linenum); >+ } > if (!*activep) > continue; > options->auth_methods[ >@@ -2143,11 +2166,13 @@ dump_cfg_strarray_oneline(ServerOpCodes code, u_int count, char **vals) > { > u_int i; > >- if (count <= 0) >+ if (count <= 0 && code != sAuthenticationMethods) > return; > printf("%s", lookup_opcode_name(code)); > for (i = 0; i < count; i++) > printf(" %s", vals[i]); >+ if (code == sAuthenticationMethods && count == 0) >+ printf(" any"); > printf("\n"); > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 2398
:
2620
|
2836
|
2837
|
2838