Bugzilla – Attachment 3084 Details for
Bug 2664
Boolean option parsing is excessively case-sensitive
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
reuse parse_multistate for servconf.c parse_flag
bz2664.diff (text/plain), 1.24 KB, created by
Damien Miller
on 2017-11-03 14:18:29 AEDT
(
hide
)
Description:
reuse parse_multistate for servconf.c parse_flag
Filename:
MIME Type:
Creator:
Damien Miller
Created:
2017-11-03 14:18:29 AEDT
Size:
1.24 KB
patch
obsolete
>Index: servconf.c >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/servconf.c,v >retrieving revision 1.318 >diff -u -p -r1.318 servconf.c >--- servconf.c 25 Oct 2017 02:10:39 -0000 1.318 >+++ servconf.c 3 Nov 2017 03:19:04 -0000 >@@ -1021,6 +1021,11 @@ struct multistate { > char *key; > int value; > }; >+static const struct multistate multistate_flag[] = { >+ { "yes", 1 }, >+ { "no", 0 }, >+ { NULL, -1 } >+}; > static const struct multistate multistate_addressfamily[] = { > { "inet", AF_INET }, > { "inet6", AF_INET6 }, >@@ -1255,21 +1260,8 @@ process_server_config_line(ServerOptions > case sIgnoreRhosts: > intptr = &options->ignore_rhosts; > parse_flag: >- arg = strdelim(&cp); >- if (!arg || *arg == '\0') >- fatal("%s line %d: missing yes/no argument.", >- filename, linenum); >- value = 0; /* silence compiler */ >- if (strcmp(arg, "yes") == 0) >- value = 1; >- else if (strcmp(arg, "no") == 0) >- value = 0; >- else >- fatal("%s line %d: Bad yes/no argument: %s", >- filename, linenum, arg); >- if (*activep && *intptr == -1) >- *intptr = value; >- break; >+ multistate_ptr = multistate_flag; >+ goto parse_multistate; > > case sIgnoreUserKnownHosts: > intptr = &options->ignore_user_known_hosts;
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
Flags:
dtucker
:
ok+
Actions:
View
|
Diff
Attachments on
bug 2664
: 3084