Bug 3474 - ssh_config can escape double quotes with a backslash
Summary: ssh_config can escape double quotes with a backslash
Status: NEW
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: ssh (show other bugs)
Version: 9.0p1
Hardware: Other Linux
: P5 enhancement
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-23 00:39 AEST by unknowndevqwq
Modified: 2022-10-13 15:20 AEDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description unknowndevqwq 2022-09-23 00:39:22 AEST
Some match exec rules may require more than one pair of double quotes, but the current ssh_config will simply truncate the first pair and ignore the backslash-escaped double quotes and other special character conventions
Comment 1 Damien Miller 2022-09-24 11:49:44 AEST
readconf.c:match_cfg_line() probably needs to be converted from strdelim() to argv_split() for this to happen.
Comment 2 unknowndevqwq 2022-10-11 04:51:15 AEDT
(In reply to Damien Miller from comment #1)
> readconf.c:match_cfg_line() probably needs to be converted from
> strdelim() to argv_split() for this to happen.

s/strdelim()/argv_split()/
Like this?
Comment 3 Damien Miller 2022-10-11 09:34:05 AEDT
No unfortunately - it's a bit more of a substantial rewrite than that. strdelim() is an incremental tokeniser whereas argv_split() turns a string into a vector of arguments in one go.

https://github.com/openssh/openssh-portable/commit/ea9e45c89a is the commit where we started using it for config parsing if you want to have a go at this yourself.
Comment 4 unknowndevqwq 2022-10-13 15:20:07 AEDT
Sorry, I can't do it.