]> granicus.if.org Git - icinga2/commitdiff
Fix objects cache dump in compat for multiline vars
authorMarkus Frosch <markus@lazyfrosch.de>
Thu, 28 May 2015 07:48:57 +0000 (09:48 +0200)
committerMichael Friedrich <michael.friedrich@netways.de>
Mon, 15 Jun 2015 15:20:43 +0000 (17:20 +0200)
Multiline vars should be written as:
  _test test1\ntest2

And not
  _test test1
test2

fixes #9328

Signed-off-by: Michael Friedrich <michael.friedrich@netways.de>
lib/compat/statusdatawriter.cpp

index a28e1ceb50c40d376315982e0d65cc25daa0a9f3..673a981c437b5a20686c19ac547d9a807f2c97f8 100644 (file)
@@ -531,7 +531,7 @@ void StatusDataWriter::DumpCustomAttributes(std::ostream& fp, const CustomVarObj
                        value = JsonEncode(kv.second);
                        is_json = true;
                } else
-                       value = kv.second;
+                       value = CompatUtility::EscapeString(kv.second);
 
                fp << "\t" "_" << kv.first << "\t" << value << "\n";
        }