Bug 2320

Summary: end-of-line comments work in sshd_config but not in ssh_config
Product: Portable OpenSSH Reporter: philcerf
Component: sshAssignee: Assigned to nobody <unassigned-bugs>
Status: CLOSED FIXED    
Severity: normal CC: djm, dtucker
Priority: P5    
Version: 6.7p1   
Hardware: Other   
OS: Linux   
Bug Depends on:    
Bug Blocks: 3217    
Attachments:
Description Flags
Strip comments from ssh config files
none
Strip comments from ssh config files none

Description philcerf 2014-11-23 05:58:00 AEDT
Dear OpenSSH developers.

I just found out that end-of-line comments, e.g.
AllowUser foo   #bar baz
seem to work in sshd_config, but they don't in ssh_config.
Having them in the later gives some error like:
$ ssh host
/etc/ssh/ssh_config line 23: garbage at end of line; "#bar".


In fact there seems to be code to search for left-over config line content in both, the parsers for ssh_config and sshd_config, it only seems to work for the former.

While it would be *very* nice to have end-of-line comments, there may be a bug hidden somewhere in servconf.c, that end-of-line comments ("the garbage") aren't noted in sshd_config.


Regards,
Philippe
Comment 1 Damien Miller 2014-12-23 15:23:13 AEDT
Created attachment 2519 [details]
Strip comments from ssh config files
Comment 2 Darren Tucker 2020-11-30 13:46:40 AEDT
Created attachment 3460 [details]
Strip comments from ssh config files

Update patch to -current
Comment 3 Darren Tucker 2020-11-30 16:37:43 AEDT
Patch has been applied and will be in the 8.5 release.  Thanks for the report.
Comment 4 Damien Miller 2021-03-04 09:52:51 AEDT
close bugs that were resolved in OpenSSH 8.5 release cycle