From e2911fcb17f7bf5d9c378fdcd915b1d03ef2e07c Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sun, 10 Feb 2008 11:08:29 +0000 Subject: [PATCH] kes Set catalog backup database and user name from values specified on the ./configure line. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/branches/Branch-2.2@6391 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/dird/bacula-dir.conf.in | 6 +++++- bacula/src/filed/backup.c | 17 +++++++++-------- bacula/technotes-2.1 | 2 ++ 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/bacula/src/dird/bacula-dir.conf.in b/bacula/src/dird/bacula-dir.conf.in index 45b8fc0e55..f2e72d6652 100644 --- a/bacula/src/dird/bacula-dir.conf.in +++ b/bacula/src/dird/bacula-dir.conf.in @@ -61,7 +61,11 @@ Job { 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 + 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" diff --git a/bacula/src/filed/backup.c b/bacula/src/filed/backup.c index db9193e716..d61c89bb02 100644 --- a/bacula/src/filed/backup.c +++ b/bacula/src/filed/backup.c @@ -1146,20 +1146,21 @@ static void strip_path(FF_PKT *ff_pkt) /* * 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 @@ static void unstrip_path(FF_PKT *ff_pkt) 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); } } diff --git a/bacula/technotes-2.1 b/bacula/technotes-2.1 index af78338276..cf8e532080 100644 --- a/bacula/technotes-2.1 +++ b/bacula/technotes-2.1 @@ -2,6 +2,8 @@ General: 10Feb08 +kes Set catalog backup database and user name from values specified on + the ./configure line. ebl Apply patch to corrent bug #1031, about wrong pool source information in job report. -- 2.39.5