From 998b63e5dbeefef631c2b55be4f056d3f1053aab Mon Sep 17 00:00:00 2001 From: Alex Harpin Date: Sat, 10 Oct 2015 15:03:38 +0100 Subject: 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 --- src/cparse/cparse_lex.l | 10 ++++++++++ 1 file changed, 10 insertions(+) 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); } +\\\"\n { + append_str("\\"); + set_ret_str(); + cparse_lval.str = strdup(out_buf); + free_str(); + ++cparse_lineno; + BEGIN(INITIAL); + return VALUE; +} + \\. { /* this will consume the \" sequence */ append_str(cparse_text); -- cgit v1.2.3