--- /dev/null
+
+ This patch fixes bcopy so that it produces correct Volumes.
+ It fixes bug #1022.
+
+ Apply this patch to version 2.2.6 and possibly any 2.2.x version with:
+
+ cd <bacula-source>
+ patch -p0 2.2.6-bcopy.patch
+ ./configure <your-options>
+ make
+ ...
+ make install
+
+
+Index: src/stored/bcopy.c
+===================================================================
+--- src/stored/bcopy.c (revision 6010)
++++ src/stored/bcopy.c (working copy)
+@@ -89,6 +89,7 @@
+ char *iVolumeName = NULL;
+ char *oVolumeName = NULL;
+ bool ignore_label_errors = false;
++ bool ok;
+
+ setlocale(LC_ALL, "");
+ bindtextdomain("bacula", LOCALEDIR);
+@@ -199,9 +200,11 @@
+ }
+ out_block = out_jcr->dcr->block;
+
+- read_records(in_jcr->dcr, record_cb, mount_next_read_volume);
+- if (!write_block_to_device(out_jcr->dcr)) {
+- Pmsg0(000, _("Write of last block failed.\n"));
++ ok = read_records(in_jcr->dcr, record_cb, mount_next_read_volume);
++ if (ok || out_dev->can_write()) {
++ if (!write_block_to_device(out_jcr->dcr)) {
++ Pmsg0(000, _("Write of last block failed.\n"));
++ }
+ }
+
+ Pmsg2(000, _("%u Jobs copied. %u records copied.\n"), jobs, records);
+@@ -253,6 +256,7 @@
+ out_dev->print_name(), out_dev->bstrerror());
+ Jmsg(out_jcr, M_FATAL, 0, _("Cannot fixup device error. %s\n"),
+ out_dev->bstrerror());
++ return false;
+ }
+ }
+ if (!write_block_to_device(out_jcr->dcr)) {
+@@ -260,8 +264,9 @@
+ out_dev->print_name(), out_dev->bstrerror());
+ Jmsg(out_jcr, M_FATAL, 0, _("Cannot fixup device error. %s\n"),
+ out_dev->bstrerror());
++ return false;
+ }
+- break;
++ return true;
+ case EOM_LABEL:
+ Pmsg0(000, _("EOM label not copied.\n"));
+ return true;
+@@ -269,7 +274,7 @@
+ Pmsg0(000, _("EOT label not copied.\n"));
+ return true;
+ default:
+- break;
++ return true;
+ }
+ }
+
+@@ -283,7 +288,7 @@
+ out_dev->print_name(), out_dev->bstrerror());
+ Jmsg(out_jcr, M_FATAL, 0, _("Cannot fixup device error. %s\n"),
+ out_dev->bstrerror());
+- break;
++ return false;
+ }
+ }
+ return true;
--- /dev/null
+
+ This patch eliminates spurious output to the console during a VerifyVolume
+ job that contains encrypted data.
+ It fixes bug #1024.
+
+ Apply this patch to Bacula version 2.2.6 and previous 2.2.x versions with:
+
+ cd <bacula-source>
+ patch -p0 <2.2.6-verify-vol.patch
+ ./configure <your-options>
+ make
+ ...
+ make install
+
+
+Index: src/filed/verify_vol.c
+===================================================================
+--- src/filed/verify_vol.c (revision 6010)
++++ src/filed/verify_vol.c (working copy)
+@@ -211,19 +211,6 @@
+ }
+ break;
+
+- /* Data streams to ignore */
+- case STREAM_ENCRYPTED_SESSION_DATA:
+- case STREAM_FILE_DATA:
+- case STREAM_SPARSE_DATA:
+- case STREAM_WIN32_DATA:
+- case STREAM_WIN32_GZIP_DATA:
+- case STREAM_GZIP_DATA:
+- case STREAM_SPARSE_GZIP_DATA:
+- case STREAM_SIGNED_DIGEST:
+-
+- /* Do nothing */
+- break;
+-
+ case STREAM_MD5_DIGEST:
+ bin_to_base64(digest, sizeof(digest), (char *)sd->msg, CRYPTO_DIGEST_MD5_SIZE, true);
+ Dmsg2(400, "send inx=%d MD5=%s\n", jcr->JobFiles, digest);
+@@ -256,9 +243,10 @@
+ Dmsg2(20, "bfiled>bdird: SHA512 len=%d: msg=%s\n", dir->msglen, dir->msg);
+ break;
+
++ /* Ignore everything else */
+ default:
+- Pmsg2(0, "None of above!!! stream=%d data=%s\n", stream,sd->msg);
+ break;
++
+ } /* end switch */
+ } /* end while bnet_get */
+ set_jcr_job_status(jcr, JS_Terminated);
}
break;
- /* Data streams to ignore */
- case STREAM_ENCRYPTED_SESSION_DATA:
- case STREAM_FILE_DATA:
- case STREAM_SPARSE_DATA:
- case STREAM_WIN32_DATA:
- case STREAM_WIN32_GZIP_DATA:
- case STREAM_GZIP_DATA:
- case STREAM_SPARSE_GZIP_DATA:
- case STREAM_SIGNED_DIGEST:
-
- /* Do nothing */
- break;
-
case STREAM_MD5_DIGEST:
bin_to_base64(digest, sizeof(digest), (char *)sd->msg, CRYPTO_DIGEST_MD5_SIZE, true);
Dmsg2(400, "send inx=%d MD5=%s\n", jcr->JobFiles, digest);
Dmsg2(20, "bfiled>bdird: SHA512 len=%d: msg=%s\n", dir->msglen, dir->msg);
break;
+ /* Ignore everything else */
default:
- Pmsg2(0, "None of above!!! stream=%d data=%s\n", stream,sd->msg);
break;
+
} /* end switch */
} /* end while bnet_get */
set_jcr_job_status(jcr, JS_Terminated);
char *iVolumeName = NULL;
char *oVolumeName = NULL;
bool ignore_label_errors = false;
+ bool ok;
setlocale(LC_ALL, "");
bindtextdomain("bacula", LOCALEDIR);
}
out_block = out_jcr->dcr->block;
- read_records(in_jcr->dcr, record_cb, mount_next_read_volume);
- if (!write_block_to_device(out_jcr->dcr)) {
- Pmsg0(000, _("Write of last block failed.\n"));
+ ok = read_records(in_jcr->dcr, record_cb, mount_next_read_volume);
+ if (ok || out_dev->can_write()) {
+ if (!write_block_to_device(out_jcr->dcr)) {
+ Pmsg0(000, _("Write of last block failed.\n"));
+ }
}
Pmsg2(000, _("%u Jobs copied. %u records copied.\n"), jobs, records);
out_dev->print_name(), out_dev->bstrerror());
Jmsg(out_jcr, M_FATAL, 0, _("Cannot fixup device error. %s\n"),
out_dev->bstrerror());
+ return false;
}
}
if (!write_block_to_device(out_jcr->dcr)) {
out_dev->print_name(), out_dev->bstrerror());
Jmsg(out_jcr, M_FATAL, 0, _("Cannot fixup device error. %s\n"),
out_dev->bstrerror());
+ return false;
}
- break;
+ return true;
case EOM_LABEL:
Pmsg0(000, _("EOM label not copied.\n"));
return true;
Pmsg0(000, _("EOT label not copied.\n"));
return true;
default:
- break;
+ return true;
}
}
out_dev->print_name(), out_dev->bstrerror());
Jmsg(out_jcr, M_FATAL, 0, _("Cannot fixup device error. %s\n"),
out_dev->bstrerror());
- break;
+ return false;
}
}
return true;
Technical notes on version 2.2
General:
+03Dec07
+kes This patch fixes bcopy so that it produces correct Volumes.
+ It fixes bug #1022.
+kes This patch eliminates spurious output to the console during a VerifyVolume
+ job that contains encrypted data. It fixes bug #1024.
02Dec07
kes This patch prevents the 'status dir' command from trying to use a scratch
volume and possibly moving it from one pool to another. This patch fixes