diff options
author | Alex Harpin <development@landsofshadow.co.uk> | 2015-10-10 15:03:38 +0100 |
---|---|---|
committer | Alex Harpin <development@landsofshadow.co.uk> | 2015-10-10 15:03:38 +0100 |
commit | 998b63e5dbeefef631c2b55be4f056d3f1053aab (patch) | |
tree | 212cb02bf4830d9f775261ed90a7abd763714150 /src/cparse | |
parent | 8c9b08246fe9aa84767d694e359bdb0033356a0e (diff) | |
download | vyatta-cfg-998b63e5dbeefef631c2b55be4f056d3f1053aab.tar.gz vyatta-cfg-998b63e5dbeefef631c2b55be4f056d3f1053aab.zip |
vyatta-cfg: double quoted config values ending in \ are not reboot safe
Configurations that contain double quoted values that ended in \ were
causing parse errors on load / reboot, resulting in a failure to load
the config file and an empty config.
This commit adds extra logic to the lex parsing of the config file to
catch this particular case whilst still allowing escaped quotes in the
middle of quoted values.
Bug #593 http://bugzilla.vyos.net/show_bug.cgi?id=593
Diffstat (limited to 'src/cparse')
-rw-r--r-- | src/cparse/cparse_lex.l | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/cparse/cparse_lex.l b/src/cparse/cparse_lex.l index 49f8d47..8fcd5f3 100644 --- a/src/cparse/cparse_lex.l +++ b/src/cparse/cparse_lex.l @@ -170,6 +170,16 @@ free_str() append_str(cparse_text); } +<sQStr>\\\"\n { + append_str("\\"); + set_ret_str(); + cparse_lval.str = strdup(out_buf); + free_str(); + ++cparse_lineno; + BEGIN(INITIAL); + return VALUE; +} + <sQStr>\\. { /* this will consume the \" sequence */ append_str(cparse_text); |