--- /dev/null
+
+ This patch automatically adds the Bacula database and user name to
+ the default make_catalog_backup Run script call line in the bacula-dir.conf
+ file.
+
+ Apply it to version 2.2.8 or earlier with:
+
+ cd <bacula-source>
+ patch -p0 <2.2.8-bacula-conf.patch
+ ./configure <your-options>
+ make
+ ...
+ make install
+
+
+Index: src/dird/bacula-dir.conf.in
+===================================================================
+--- src/dird/bacula-dir.conf.in (revision 6327)
++++ src/dird/bacula-dir.conf.in (working copy)
+@@ -61,7 +61,11 @@
+ FileSet="Catalog"
+ Schedule = "WeeklyCycleAfterBackup"
+ # This creates an ASCII copy of the catalog
+- RunBeforeJob = "@scriptdir@/make_catalog_backup bacula bacula"
++ # WARNING!!! Passing the password via the command line is insecure.
++ # see comments in make_catalog_backup for details.
++ # Arguments to make_catalog_backup are:
++ # make_catalog_backup <database-name> <user-name> <password> <host>
++ RunBeforeJob = "@scriptdir@/make_catalog_backup @db_name@ @db_user@"
+ # This deletes the copy of the catalog
+ RunAfterJob = "@scriptdir@/delete_catalog_backup"
+ Write Bootstrap = "@working_dir@/BackupCatalog.bsr"
--- /dev/null
+
+ This patch should fix bug #1047 -- heap corruption when using
+ strippath on certain directories.
+
+ Apply it to 2.2.8 (probably prior versions) with:
+
+ cd <bacula-source>
+ patch -p0 <2.2.8-strip-path.patch
+ ./configure <your-options>
+ make
+ ...
+ make install
+
+
+Index: src/filed/backup.c
+===================================================================
+--- src/filed/backup.c (revision 6390)
++++ src/filed/backup.c (revision 6391)
+@@ -1146,20 +1146,21 @@
+ /*
+ * Strip path. If it doesn't succeed put it back. If
+ * it does, and there is a different link string,
+- * attempt to strip the link. If it fails, but them
++ * attempt to strip the link. If it fails, back them
+ * both back.
++ * Don't strip symlinks.
+ * I.e. if either stripping fails don't strip anything.
+ */
+ if (do_strip(ff_pkt->strip_path, ff_pkt->fname)) {
+- if (ff_pkt->fname != ff_pkt->link) {
++ if (ff_pkt->type != FT_LNK && ff_pkt->fname != ff_pkt->link) {
+ pm_strcpy(ff_pkt->link_save, ff_pkt->link);
+ if (!do_strip(ff_pkt->strip_path, ff_pkt->link)) {
+- strcpy(ff_pkt->link, ff_pkt->link_save);
+- strcpy(ff_pkt->fname, ff_pkt->fname_save);
++ pm_strcpy(ff_pkt->link, ff_pkt->link_save);
++ pm_strcpy(ff_pkt->fname, ff_pkt->fname_save);
+ }
+ }
+ } else {
+- strcpy(ff_pkt->fname, ff_pkt->fname_save);
++ pm_strcpy(ff_pkt->fname, ff_pkt->fname_save);
+ }
+ Dmsg2(200, "fname=%s stripped=%s\n", ff_pkt->fname_save, ff_pkt->fname);
+ }
+@@ -1169,8 +1170,8 @@
+ if (!(ff_pkt->flags & FO_STRIPPATH) || ff_pkt->strip_path <= 0) {
+ return;
+ }
+- strcpy(ff_pkt->fname, ff_pkt->fname_save);
+- if (ff_pkt->fname != ff_pkt->link) {
+- strcpy(ff_pkt->link, ff_pkt->link_save);
++ pm_strcpy(ff_pkt->fname, ff_pkt->fname_save);
++ if (ff_pkt->type != FT_LNK && ff_pkt->fname != ff_pkt->link) {
++ pm_strcpy(ff_pkt->link, ff_pkt->link_save);
+ }
+ }