From: Eric Bollengier Date: Wed, 28 Jun 2023 15:03:53 +0000 (+0200) Subject: Fix error message code when a FileDaemon cannot connect a Director X-Git-Tag: Beta-15.0.0~168 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1da01dd7ca16799ded27cfe150732f4b4745937e;p=thirdparty%2Fbacula.git Fix error message code when a FileDaemon cannot connect a Director --- diff --git a/bacula/src/lib/bsockcore.c b/bacula/src/lib/bsockcore.c index 366cb0c69..80b16be2c 100644 --- a/bacula/src/lib/bsockcore.c +++ b/bacula/src/lib/bsockcore.c @@ -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; diff --git a/bacula/src/lib/message.c b/bacula/src/lib/message.c index 408c430cb..813a18390 100644 --- a/bacula/src/lib/message.c +++ b/bacula/src/lib/message.c @@ -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; } }