--- smsdaemon/plugins/ShellExecPlugin.cpp 2008/06/11 14:25:08 55 +++ smsdaemon/plugins/ShellExecPlugin.cpp 2008/06/11 15:55:18 56 @@ -3,18 +3,30 @@ #include "util.h" -ShellExecPlugin::ShellExecPlugin(std::string pluginCommand, std::string exeCommand) +ShellExecPlugin::ShellExecPlugin(std::string pluginCommand, std::string exeCommand, bool allowParameters) : Plugin(pluginCommand, std::string("ShellExec: ")+exeCommand ), - _exeCommand(exeCommand) + _exeCommand(exeCommand), + _allowParameters(allowParameters) { } void ShellExecPlugin::Execute(IGsmModem& modem, SMS& sms) { - std::string parameters = GetSmsData(sms); - parameters = Util::str_replace(parameters,";"); + std::string command = _exeCommand; - std::string command = _exeCommand + " " + parameters; + if (_allowParameters) + { + std::string parameters = GetSmsData(sms); + + parameters = Util::str_replace(parameters, "||"); + parameters = Util::str_replace(parameters, "&&"); + parameters = Util::str_replace(parameters, ";"); + parameters = Util::str_replace(parameters, "'"); + parameters = Util::str_replace(parameters, "\""); + + command += " "; + command += parameters; + } int retval = ::system( command.c_str() ); std::string message;