From 370a1127e9788a0e286689103ddc95293d44c481 Mon Sep 17 00:00:00 2001 From: Per von Zweigbergk Date: Thu, 5 Nov 2015 17:23:41 +0100 Subject: [PATCH] Fixed invalid quoting for network device names Quoting needs to be with single quotes, not double quotes. Also single quotes need to be escaped. refs #10544 Signed-off-by: Jean Flach --- plugins/check_network.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/check_network.cpp b/plugins/check_network.cpp index d1e9d1937..f140b3f16 100644 --- a/plugins/check_network.cpp +++ b/plugins/check_network.cpp @@ -30,6 +30,7 @@ #include #include "check_network.h" +#include "boost/algorithm/string/replace.hpp" #define VERSION 1.1 @@ -188,7 +189,8 @@ INT printOutput(printInfoStruct& printInfo, CONST std::vector& vInte std::wcout << "\tNo friendly name found, using adapter name\n"; wsFriendlyName = it->name; } - tss << L"netI=\"" << wsFriendlyName << L"\";in=" << it->BytesInSec << "B/s;out=" << it->BytesOutSec << L"B/s "; + boost::algorithm::replace_all(wsFriendlyName, "'", "''"); + tss << L"netI='" << wsFriendlyName << L"';in=" << it->BytesInSec << "B/s;out=" << it->BytesOutSec << L"B/s "; } if (printInfo.warn.rend(tIn + tOut)) -- 2.40.0