]> git.sur5r.net Git - bacula/bacula/commitdiff
Add debug code for bug #2356
authorKern Sibbald <kern@sibbald.com>
Thu, 12 Jul 2018 09:37:24 +0000 (11:37 +0200)
committerKern Sibbald <kern@sibbald.com>
Thu, 12 Jul 2018 09:38:18 +0000 (11:38 +0200)
bacula/src/dird/catreq.c

index 9c9d1f3d84a316a4179f11bb7e8cc60a49141470..88ddd4729680c75937990e21f396aa26731733dc 100644 (file)
@@ -657,11 +657,14 @@ static void update_attribute(JCR *jcr, char *msg, int32_t msglen)
                         db_strerror(jcr->db));
             }
             jcr->cached_attribute = false;
-         } else {
+         } else if (ar->FileId != 0) {
             if (!db_add_digest_to_file_record(jcr, jcr->db, ar->FileId, digestbuf, type)) {
                Jmsg(jcr, M_ERROR, 0, _("Catalog error updating file digest. %s"),
                   db_strerror(jcr->db));
             }
+         } else { /* Something is wrong FileId == 0 */
+            Jmsg(jcr, M_WARNING, 0, "Illegal FileId in update attribute: FileId=0 Stream=%d fname=%s\n",
+                 ar->Stream, ar->fname);
          }
       }
    }