]> 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:21:57 +0000 (17:21 +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 75b188a2d8315f60843c610e77b10b649720bddb..2e33380417c3a74d0e38a6ef5320534817f536ad 100644 (file)
@@ -530,7 +530,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";
        }