Allow POSIX extended regexps for module preconditions.

This commit is contained in:
Ramon Novoa 2015-09-08 10:40:35 +02:00
parent bd432db9fd
commit b717b1d56c
1 changed files with 2 additions and 2 deletions

View File

@ -1170,7 +1170,7 @@ Pandora_Module::addGenericCondition (string condition, list<Condition *> **condi
cond->string_value = string_value; cond->string_value = string_value;
cond->command = command; cond->command = command;
cond->command = "cmd.exe /c \"" + cond->command + "\""; cond->command = "cmd.exe /c \"" + cond->command + "\"";
if (regcomp (&(cond->regexp), string_value, 0) != 0) { if (regcomp (&(cond->regexp), string_value, REG_EXTENDED) != 0) {
pandoraDebug ("Invalid regular expression %s", string_value); pandoraDebug ("Invalid regular expression %s", string_value);
delete (cond); delete (cond);
return; return;
@ -1242,7 +1242,7 @@ Pandora_Module::addIntensiveCondition (string condition) {
} else if (sscanf (condition.c_str (), "=~ %1023s", string_value) == 1) { } else if (sscanf (condition.c_str (), "=~ %1023s", string_value) == 1) {
cond->operation = "=~"; cond->operation = "=~";
cond->string_value = string_value; cond->string_value = string_value;
if (regcomp (&(cond->regexp), string_value, 0) != 0) { if (regcomp (&(cond->regexp), string_value, REG_EXTENDED) != 0) {
pandoraDebug ("Invalid regular expression %s", string_value); pandoraDebug ("Invalid regular expression %s", string_value);
delete (cond); delete (cond);
return; return;