From: Eric Bollengier Date: Tue, 10 Jan 2023 17:18:05 +0000 (+0100) Subject: Use the malware command name as description rather than "user defined" X-Git-Tag: Beta-15.0.0~275 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=553a962dfb68eaa878185df1dcc8323d40b3821c;p=thirdparty%2Fbacula.git Use the malware command name as description rather than "user defined" --- diff --git a/bacula/src/dird/malware.c b/bacula/src/dird/malware.c index df418a950..5f74fd0ed 100644 --- a/bacula/src/dird/malware.c +++ b/bacula/src/dird/malware.c @@ -275,15 +275,15 @@ int check_malware(JCR *jcr, const char *jobids, POOLMEM **errmsg) 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);