if (director->get_malwaredb_command) {
regex_t re;
regmatch_t pmatch[3];
- if (regcomp(&re, ".*get_malware_(.+)$", 0) != 0) {
+ if (regcomp(&re, "get_malware_(.+)$", 0) != 0) {
Dmsg0(dbglvl, "Unable to compile regex\n");
}
- if (regexec(&re, director->get_malwaredb_command, 3, pmatch, 0) == 0) {
+ if (regexec(&re, director->get_malwaredb_command, 2, pmatch, REG_EXTENDED) == 0) {
source = director->get_malwaredb_command + pmatch[1].rm_so;
} else {
- source = "user specified";
+ source = director->get_malwaredb_command;
}
regfree(&re);