From: Alison Chaiken Date: Sun, 2 Oct 2016 07:03:04 +0000 (+0200) Subject: Warn of Storage Daemon version incompatibility if label fails. Bug #2193 X-Git-Tag: Release-7.4.5~19 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=10ecaa87061938356c8cb10f6f4afec1e2fc9260;p=bacula%2Fbacula Warn of Storage Daemon version incompatibility if label fails. Bug #2193 Print an error message identifying incompatibilty between Storage Daemon and Director versions if the label-request response from the SD contains "3000 OK" but does not match the pattern the Director expects. Otherwise novice users may be misled by print_reminder into believing that they have drive-mounting problems. --- diff --git a/bacula/src/dird/ua_label.c b/bacula/src/dird/ua_label.c index e5cc16cb75..fb752c2968 100644 --- a/bacula/src/dird/ua_label.c +++ b/bacula/src/dird/ua_label.c @@ -707,9 +707,15 @@ static bool send_label_request(UAContext *ua, MEDIA_DBR *mr, MEDIA_DBR *omr, while (sd->recv() >= 0) { ua->send_msg("%s", sd->msg); - if (sscanf(sd->msg, "3000 OK label. VolBytes=%llu VolABytes=%lld VolType=%d ", - &VolBytes, &VolABytes, &VolType) == 3) { - ok = true; + if (strstr((const POOLMEM *) sd->msg, "3000 OK label")) { + ok = false; + if (sscanf(sd->msg, "3000 OK label. VolBytes=%llu VolABytes=%lld VolType=%d ", + &VolBytes, &VolABytes, &VolType) == 3) { + ok = true; + } + } + if (!ok) { + ua->error_msg("Volume label failed: Storage Daemon and Director are incompatible versions."); } } unbash_spaces(mr->VolumeName);