]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/ua_label.c
Warn of Storage Daemon version incompatibility if label fails. Bug #2193
[bacula/bacula] / bacula / src / dird / ua_label.c
index e5cc16cb75d84a8d3c00c4532481a5ada561a10c..fb752c2968890a58b1d7f6969cef20efbd685dec 100644 (file)
@@ -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);