]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Use the malware command name as description rather than "user defined"
authorEric Bollengier <eric@baculasystems.com>
Tue, 10 Jan 2023 17:18:05 +0000 (18:18 +0100)
committerEric Bollengier <eric@baculasystems.com>
Thu, 14 Sep 2023 11:57:00 +0000 (13:57 +0200)
bacula/src/dird/malware.c

index df418a9501aaac3030bdb9eed694d1f422407b1e..5f74fd0eddd4fd9e5a3f6649a53b10540557286b 100644 (file)
@@ -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);