Bug 2664 - Boolean option parsing is excessively case-sensitive
Summary: Boolean option parsing is excessively case-sensitive
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: sshd (show other bugs)
Version: 7.4p1
Hardware: Other Linux
: P5 enhancement
Assignee: Damien Miller
URL: https://bugs.launchpad.net/bugs/1656557
Keywords:
Depends on:
Blocks: V_7_7
  Show dependency treegraph
 
Reported: 2017-01-15 12:13 AEDT by Colin Watson
Modified: 2021-04-23 15:00 AEST (History)
2 users (show)

See Also:


Attachments
reuse parse_multistate for servconf.c parse_flag (1.24 KB, patch)
2017-11-03 14:18 AEDT, Damien Miller
dtucker: ok+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Colin Watson 2017-01-15 12:13:45 AEDT
The pure yes/no options in sshd that are handled by parse_flag are case-sensitive.  For example, "PasswordAuthentication yes" is accepted while "PasswordAuthentication Yes" is not.  This seems unnecessarily picky, since the meaning is unambiguous and it's an easy mistake for users to make.  It's also at variance with (1) all the options handled by parse_multistate in servconf.c and (2) the corresponding code in readconf.c to handle client options, both of which use strcasecmp.

I'd suggest that it would make sense to make the handling in servconf.c work the same way as that in readconf.c, where parse_flag just sets multistate_ptr = multistate_flag and falls through to parse_multistate; the code would even be shorter as a result.
Comment 1 Damien Miller 2017-11-03 14:18:29 AEDT
Created attachment 3084 [details]
reuse parse_multistate for servconf.c parse_flag

Fine idea. I love deleting code.
Comment 2 Damien Miller 2017-11-03 16:17:40 AEDT
Committed - this will be in OpenSSH 7.7
Comment 3 Damien Miller 2021-04-23 15:00:56 AEST
closing resolved bugs as of 8.6p1 release