From: Christian Herdtweck Date: Wed, 21 May 2014 10:06:04 +0000 (+0200) Subject: changed escaping of shell args in status notifier command: escape each arg separately... X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=ff031c0b466617d5bceea1de81eb057da0afa40a;p=pingcheck changed escaping of shell args in status notifier command: escape each arg separately instead of the whole argument string at once --- diff --git a/src/link/statusnotifiercommand.cpp b/src/link/statusnotifiercommand.cpp index 3b9cb51..3372e8c 100644 --- a/src/link/statusnotifiercommand.cpp +++ b/src/link/statusnotifiercommand.cpp @@ -24,6 +24,7 @@ on this file might be covered by the GNU General Public License. #include #include +#include #include #include @@ -133,8 +134,10 @@ string StatusNotifierCommand::get_arguments_string() const // retrieve the arguments string from within the command string const size_t args_begin_pos = CommandStr.find( " " ) + 1; const size_t args_end_pos = CommandStr.length(); - string args = CommandStr.substr( args_begin_pos, args_end_pos ); - args = escape_shellarg( args ); - - return args; + std::list< string > args = I2n::split_string( + CommandStr.substr( args_begin_pos, args_end_pos ), + " ", true); + BOOST_FOREACH( string arg, args ) + arg = escape_shellarg( arg ); + return I2n::join_string( args, " " ); }