]> git.sur5r.net Git - bacula/bacula/commitdiff
Verify modifications
authorKern Sibbald <kern@sibbald.com>
Sun, 1 Sep 2002 10:17:05 +0000 (10:17 +0000)
committerKern Sibbald <kern@sibbald.com>
Sun, 1 Sep 2002 10:17:05 +0000 (10:17 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@136 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/cats/sql_create.c
bacula/src/dird/fd_cmds.c
bacula/src/dird/verify.c
bacula/src/version.h

index 6db2e8e9625c96a6b8fe9ddae9ea03929d55f607..16370169a163567eb547de2f6bd7570b9fbc1938 100644 (file)
@@ -526,8 +526,8 @@ static int db_create_file_record(B_DB *mdb, ATTR_DBR *ar)
    /* Must create it */
    Mmsg(&mdb->cmd,
 "INSERT INTO File (FileIndex, JobId, PathId, FilenameId, \
-LStat, MD5) VALUES (%d, %d, %d, %d, '%s', '0')", 
-     (int)ar->FileIndex, ar->JobId, ar->PathId, ar->FilenameId, 
+LStat, MD5) VALUES (%u, %u, %u, %u, '%s', '0')", 
+      ar->FileIndex, ar->JobId, ar->PathId, ar->FilenameId, 
       ar->attr);
 
    if (!INSERT_DB(mdb, mdb->cmd)) {
index c1c25c22eb6dc48a289c9434fbd808ac881bfada..155b1428a6d39180d553c6dd48684b20cce3fcc8 100644 (file)
@@ -189,6 +189,7 @@ int get_attributes_and_put_in_catalog(JCR *jcr)
    fd = jcr->file_bsock;
    jcr->jr.FirstIndex = 1;
    memset(&ar, 0, sizeof(ar));
+   jcr->FileIndex = 0;
 
    Dmsg0(120, "bdird: waiting to receive file attributes\n");
    /* Pickup file attributes and signature */
@@ -227,9 +228,10 @@ msglen=%d msg=%s\n"), len, fd->msglen, fd->msg);
 
       if (stream == STREAM_UNIX_ATTRIBUTES) {
         jcr->JobFiles++;
+        jcr->FileIndex = file_index;
         ar.attr = attr;
         ar.fname = jcr->fname;
-        ar.FileIndex = 0;           /* used as mark field during compare */
+        ar.FileIndex = file_index;
         ar.Stream = stream;
         ar.link = NULL;
         ar.JobId = jcr->JobId;
@@ -246,11 +248,11 @@ msglen=%d msg=%s\n"), len, fd->msglen, fd->msg);
            jcr->JobStatus = JS_Error;
            continue;
         }
-        jcr->FileIndex = file_index;
         jcr->FileId = ar.FileId;
       } else if (stream == STREAM_MD5_SIGNATURE) {
         if (jcr->FileIndex != (uint32_t)file_index) {
-            Jmsg0(jcr, M_ERROR, 0, _("Got MD5 but not same block as attributes\n"));
+            Jmsg2(jcr, M_ERROR, 0, _("MD5 index %d not same as attributes %d\n"),
+              file_index, jcr->FileIndex);
            jcr->JobStatus = JS_Error;
            continue;
         }
index cbea34f7ae68a78f35e770064441b862ecfbaf50..3e52b7d12589545406d075c38b2ec9e307089e0d 100644 (file)
@@ -377,11 +377,12 @@ int get_attributes_and_compare_to_catalog(JCR *jcr, JobId_t JobId)
    char buf[MAXSTRING];
    POOLMEM *fname = get_pool_memory(PM_MESSAGE);
    int do_MD5 = FALSE;
-   long file_index = 0, attr_file_index = 0;
+   long file_index = 0;
 
    memset(&fdbr, 0, sizeof(FILE_DBR));
    fd = jcr->file_bsock;
    fdbr.JobId = JobId;
+   jcr->FileIndex = 0;
    
    Dmsg0(20, "bdird: waiting to receive file attributes\n");
    /*
@@ -427,7 +428,7 @@ int get_attributes_and_compare_to_catalog(JCR *jcr, JobId_t JobId)
       if (stream == STREAM_UNIX_ATTRIBUTES) {
          Dmsg2(400, "file_index=%d attr=%s\n", file_index, attr);
         jcr->JobFiles++;
-        attr_file_index = file_index;    /* remember attribute file_index */
+        jcr->FileIndex = file_index;    /* remember attribute file_index */
         decode_stat(attr, &statf);  /* decode file stat packet */
         do_MD5 = FALSE;
         jcr->fn_printed = FALSE;
@@ -559,9 +560,9 @@ int get_attributes_and_compare_to_catalog(JCR *jcr, JobId_t JobId)
          * When ever we get an MD5 signature is MUST have been
          * preceded by an attributes record, which sets attr_file_index
          */
-        if (attr_file_index != file_index) {
+        if (jcr->FileIndex != (uint32_t)file_index) {
             Jmsg2(jcr, M_FATAL, 0, _("MD5 index %d not same as attributes %d\n"),
-              file_index, attr_file_index);
+              file_index, jcr->FileIndex);
            goto bail_out;
         } 
         if (do_MD5) {
@@ -587,7 +588,7 @@ int get_attributes_and_compare_to_catalog(JCR *jcr, JobId_t JobId)
    }
 
    /* Now find all the files that are missing -- i.e. all files in
-    *  the database where the FileIndex != current JobId
+    *  the database where the MarkedId != current JobId
     */
    jcr->fn_printed = FALSE;
    sprintf(buf, 
index 432842cad84700def03333fc62649dfc08412b86..94f4838f211c40e9edb289b6470c2372f0986f2d 100644 (file)
@@ -1,8 +1,8 @@
 /* */
 #define VERSION "1.25"
 #define VSTRING "1"
-#define DATE    "30 August 2002"
-#define LSMDATE "30Aug02"
+#define DATE    "01 September 2002"
+#define LSMDATE "01Sep02"
 
 /* Debug flags */
 #define DEBUG 1