summaryrefslogtreecommitdiffstats
path: root/servconf.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2021-06-08 07:07:15 +0000
committerDamien Miller <djm@mindrot.org>2021-06-08 17:12:52 +1000
commitea9e45c89a4822d74a9d97fef8480707d584da4d (patch)
treeca395e232f22801640596ae3240f5a3c5882cbe5 /servconf.c
parentd786424986c04d1d375f231fda177c8408e05c3e (diff)
upstream: Switch ssh_config parsing to use argv_split()
This fixes a couple of problems with the previous tokeniser, strdelim() 1. strdelim() is permissive wrt accepting '=' characters. This is intended to allow it to tokenise "Option=value" but because it cannot keep state, it will incorrectly split "Opt=val=val2". 2. strdelim() has rudimentry handling of quoted strings, but it is incomplete and inconsistent. E.g. it doesn't handle escaped quotes inside a quoted string. 3. It has no support for stopping on a (unquoted) comment. Because of this readconf.c r1.343 added chopping of lines at '#', but this caused a regression because these characters may legitimately appear inside quoted strings. The new tokeniser is stricter is a number of cases, including #1 above but previously it was also possible for some directives to appear without arguments. AFAIK these were nonsensical in all cases, and the new tokeniser refuses to accept them. The new code handles quotes much better, permitting quoted space as well as escaped closing quotes. Finally, comment handling should be fixed - the tokeniser will terminate only on unquoted # characters. feedback & ok markus@ tested in snaps for the last five or so days - thanks Theo and those who caught bugs OpenBSD-Commit-ID: dc72fd12af9d5398f4d9e159d671f9269c5b14d5
Diffstat (limited to 'servconf.c')
0 files changed, 0 insertions, 0 deletions