diff -u bacula-2.0.3/debian/changelog bacula-2.0.3/debian/changelog --- bacula-2.0.3/debian/changelog +++ bacula-2.0.3/debian/changelog @@ -1,3 +1,10 @@ +bacula (2.0.3-4ubuntu3) gutsy; urgency=low + + * restore.patch: apply a patch from upstream which fixes a serious file + restore bug (http://www.bacula.org/downloads/bug-935.txt) (LP: #141329) + + -- Luca Falavigna Fri, 21 Sep 2007 22:16:19 +0200 + bacula (2.0.3-4ubuntu2) gutsy; urgency=low * Do non build-depend on libwxgtk2.4-dev. Closes #115120 diff -u bacula-2.0.3/debian/rules bacula-2.0.3/debian/rules --- bacula-2.0.3/debian/rules +++ bacula-2.0.3/debian/rules @@ -137,6 +137,7 @@ $(clean-upstream) $(RM) autoconf/config.cache autoconf/config.sub autoconf/config.guess autoconf/config.log config.log + $(SHELL) -c "if test -e patch-stamp; then cd src/stored; patch -p0 -R -i $(CURDIR)/debian/patches/restore.patch; fi" $(RM) *stamp* dh_clean @@ -280,6 +281,7 @@ chmod 755 debian/patches/fix_config debian/patches/fix_director \ debian/patches/extract_here chmod 755 debian/additions/bconsole + cd src/stored; patch -p0 -i $(CURDIR)/debian/patches/restore.patch touch patch-stamp only in patch2: unchanged: --- bacula-2.0.3.orig/debian/patches/restore.patch +++ bacula-2.0.3/debian/patches/restore.patch @@ -0,0 +1,73 @@ +Index: bscan.c +=================================================================== +--- bscan.c (.../tags/Release-2.0.3/bacula/src/stored) (revision 5517) ++++ bscan.c (.../branches/Branch-2.0/bacula/src/stored) (revision 5517) +@@ -328,6 +328,7 @@ + // mdcr->EndBlock = (uint32_t)dcr->file_addr; + // mdcr->EndFile = (uint32_t)(dcr->file_addr >> 32); + } ++ mdcr->VolMediaId = dcr->VolMediaId; + mjcr->read_dcr->VolLastIndex = dcr->VolLastIndex; + if (!create_jobmedia_record(db, mjcr)) { + Pmsg2(000, _("Could not create JobMedia record for Volume=%s Job=%s\n"), +@@ -472,6 +473,7 @@ + dcr->VolFirstIndex = dcr->FileIndex = 0; + dcr->StartBlock = dcr->EndBlock = 0; + dcr->StartFile = dcr->EndFile = 0; ++ dcr->VolMediaId = 0; + } + + Pmsg1(000, _("VOL_LABEL: OK for Volume: %s\n"), mr.VolumeName); +@@ -1174,6 +1176,7 @@ + dcr->EndFile = (uint32_t)(dev->file_addr >> 32); + #endif + } ++ dcr->VolMediaId = dev->VolCatInfo.VolMediaId; + + memset(&jmr, 0, sizeof(jmr)); + jmr.JobId = mjcr->JobId; +Index: askdir.c +=================================================================== +--- askdir.c (.../tags/Release-2.0.3/bacula/src/stored) (revision 5517) ++++ askdir.c (.../branches/Branch-2.0/bacula/src/stored) (revision 5517) +@@ -391,7 +391,7 @@ + dcr->StartFile, dcr->EndFile, + dcr->StartBlock, dcr->EndBlock, + dcr->Copy, dcr->Stripe, +- edit_uint64(dcr->dev->VolCatInfo.VolMediaId, ed1)); ++ edit_uint64(dcr->VolMediaId, ed1)); + Dmsg1(100, ">dird: %s", dir->msg); + if (bnet_recv(dir) <= 0) { + Dmsg0(190, "create_jobmedia error bnet_recv\n"); +Index: dev.h +=================================================================== +--- dev.h (.../tags/Release-2.0.3/bacula/src/stored) (revision 5517) ++++ dev.h (.../branches/Branch-2.0/bacula/src/stored) (revision 5517) +@@ -438,6 +438,7 @@ + uint32_t StartFile; /* Start write file */ + uint32_t StartBlock; /* Start write block */ + uint32_t EndBlock; /* Ending block written */ ++ int64_t VolMediaId; /* MediaId */ + int64_t job_spool_size; /* Current job spool size */ + int64_t max_job_spool_size; /* Max job spool size */ + char VolumeName[MAX_NAME_LENGTH]; /* Volume name */ +Index: block.c +=================================================================== +--- block.c (.../tags/Release-2.0.3/bacula/src/stored) (revision 5517) ++++ block.c (.../branches/Branch-2.0/bacula/src/stored) (revision 5517) +@@ -612,6 +612,7 @@ + dev->block_num = dcr->EndBlock; + dev->file = dcr->EndFile; + } ++ dcr->VolMediaId = dev->VolCatInfo.VolMediaId; + if (dcr->VolFirstIndex == 0 && block->FirstIndex > 0) { + dcr->VolFirstIndex = block->FirstIndex; + } +@@ -1107,6 +1108,7 @@ + dev->block_num = dcr->EndBlock; + dev->file = dcr->EndFile; + } ++ dcr->VolMediaId = dev->VolCatInfo.VolMediaId; + dev->file_addr += block->read_len; + dev->file_size += block->read_len; +