From: Kern Sibbald Date: Sun, 1 Sep 2002 10:17:05 +0000 (+0000) Subject: Verify modifications X-Git-Tag: Release-1.25~7 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=bc72c9d4b1040a77350c6c127a7c161f1f4dd8ed;p=bacula%2Fbacula Verify modifications git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@136 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/cats/sql_create.c b/bacula/src/cats/sql_create.c index 6db2e8e962..16370169a1 100644 --- a/bacula/src/cats/sql_create.c +++ b/bacula/src/cats/sql_create.c @@ -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)) { diff --git a/bacula/src/dird/fd_cmds.c b/bacula/src/dird/fd_cmds.c index c1c25c22eb..155b1428a6 100644 --- a/bacula/src/dird/fd_cmds.c +++ b/bacula/src/dird/fd_cmds.c @@ -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; } diff --git a/bacula/src/dird/verify.c b/bacula/src/dird/verify.c index cbea34f7ae..3e52b7d125 100644 --- a/bacula/src/dird/verify.c +++ b/bacula/src/dird/verify.c @@ -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, diff --git a/bacula/src/version.h b/bacula/src/version.h index 432842cad8..94f4838f21 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -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