Bug 2664

Summary: Boolean option parsing is excessively case-sensitive
Product: Portable OpenSSH Reporter: Colin Watson <cjwatson>
Component: sshdAssignee: Damien Miller <djm>
Status: CLOSED FIXED    
Severity: enhancement CC: djm, dtucker
Priority: P5    
Version: 7.4p1   
Hardware: Other   
OS: Linux   
URL: https://bugs.launchpad.net/bugs/1656557
Bug Depends on:    
Bug Blocks: 2782    
Attachments:
Description Flags
reuse parse_multistate for servconf.c parse_flag dtucker: ok+

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