]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Fix error message code when a FileDaemon cannot connect a Director
authorEric Bollengier <eric@baculasystems.com>
Wed, 28 Jun 2023 15:03:53 +0000 (17:03 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 14 Sep 2023 11:57:01 +0000 (13:57 +0200)
bacula/src/lib/bsockcore.c
bacula/src/lib/message.c

index 366cb0c69fe4be00471678f07031c2035c6ca57e..80b16be2c4ed3a44a2337e217b94f3440c053514 100644 (file)
@@ -264,6 +264,9 @@ bool BSOCKCORE::connect(JCR * jcr, int retry_interval, utime_t max_retry_time,
       now = time(NULL);
       if (begin_time + max_retry_time <= now) {
          int code = get_component_statuscode(name);
+         /*
+         * DE0029, DE0039, FE0019, FE0039, SE0039, SE0029...
+         */
          Mmsg(errmsg, _("[%cE00%d9] Unable to connect to %s on %s:%d. ERR=%s\n"),
               component_code, code, name, host, port, be.bstrerror());
          goto bail_out;
index 408c430cb22999d1f2d88065c7ec7086efcd6fed..813a18390095bccc8840b486e6cc12874f8a2f6f 100644 (file)
@@ -2172,7 +2172,7 @@ struct comp comp_codes[] = {
 int get_component_statuscode(const char *component)
 {
    for (int i=0; comp_codes[i].name ; i++) {
-      if (strcasecmp(comp_codes[i].name, component) == 0) {
+      if (strncasecmp(comp_codes[i].name, component, strlen(comp_codes[i].name)) == 0) {
          return comp_codes[i].code;
       }
    }