From e7874a04b8297bfbfdccf87248311a86178aefad Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sun, 15 Mar 2009 14:40:05 +0000 Subject: [PATCH] jh Fix by James Harper to print error code when attempting to restore two databases (only one is permitted). This responds to bug #1234. kes Apply the nodump patch supplied by Frank Kardel that fixes the NODUMP flag problem. This fixes bug #1221 git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8536 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/filed/backup.c | 22 ---------------------- bacula/src/findlib/find_one.c | 28 +++++++++++++++++++++++++++- bacula/technotes-2.5 | 10 ++++++++-- 3 files changed, 35 insertions(+), 25 deletions(-) diff --git a/bacula/src/filed/backup.c b/bacula/src/filed/backup.c index 43d98cf9c0..e0c9ba9f46 100644 --- a/bacula/src/filed/backup.c +++ b/bacula/src/filed/backup.c @@ -46,22 +46,6 @@ static bool crypto_session_start(JCR *jcr); static void crypto_session_end(JCR *jcr); static bool crypto_session_send(JCR *jcr, BSOCK *sd); -/* - * check for BSD nodump flag - */ -static bool no_dump(JCR *jcr, FF_PKT *ff_pkt) -{ -#if defined(HAVE_CHFLAGS) && defined(UF_NODUMP) - if ( (ff_pkt->flags & FO_HONOR_NODUMP) && - (ff_pkt->statp.st_flags & UF_NODUMP) ) { - Jmsg(jcr, M_INFO, 1, _(" NODUMP flag set - will not process %s\n"), - ff_pkt->fname); - return true; /* do not backup this file */ - } -#endif - return false; /* do backup */ -} - /* * Find all the requested files and send them * to the Storage daemon. @@ -305,14 +289,10 @@ int save_file(JCR *jcr, FF_PKT *ff_pkt, bool top_level) break; case FT_REGE: Dmsg1(130, "FT_REGE saving: %s\n", ff_pkt->fname); - if (no_dump(jcr, ff_pkt)) - return 1; has_file_data = true; break; case FT_REG: Dmsg1(130, "FT_REG saving: %s\n", ff_pkt->fname); - if (no_dump(jcr, ff_pkt)) - return 1; has_file_data = true; break; case FT_LNK: @@ -320,8 +300,6 @@ int save_file(JCR *jcr, FF_PKT *ff_pkt, bool top_level) break; case FT_DIRBEGIN: jcr->num_files_examined--; /* correct file count */ - if (no_dump(jcr, ff_pkt)) /* disable recursion on nodump directories */ - ff_pkt->flags |= FO_NO_RECURSION; return 1; /* not used */ case FT_NORECURSE: Jmsg(jcr, M_INFO, 1, _(" Recursion turned off. Will not descend from %s into %s\n"), diff --git a/bacula/src/findlib/find_one.c b/bacula/src/findlib/find_one.c index 57965a16f9..5619ea43a8 100644 --- a/bacula/src/findlib/find_one.c +++ b/bacula/src/findlib/find_one.c @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2000-2008 Free Software Foundation Europe e.V. + Copyright (C) 2000-2009 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -211,6 +211,22 @@ static bool volume_has_attrlist(const char *fname) return false; } +/* + * check for BSD nodump flag + */ +static bool no_dump(JCR *jcr, FF_PKT *ff_pkt) +{ +#if defined(HAVE_CHFLAGS) && defined(UF_NODUMP) + if ( (ff_pkt->flags & FO_HONOR_NODUMP) && + (ff_pkt->statp.st_flags & UF_NODUMP) ) { + Jmsg(jcr, M_INFO, 1, _(" NODUMP flag set - will not process %s\n"), + ff_pkt->fname); + return true; /* do not backup this file */ + } +#endif + return false; /* do backup */ +} + /* check if a file have changed during backup and display an error */ bool has_file_changed(JCR *jcr, FF_PKT *ff_pkt) { @@ -353,6 +369,16 @@ find_one_file(JCR *jcr, FF_PKT *ff_pkt, } ff_pkt->volhas_attrlist = volume_has_attrlist(fname); } + + /* + * Ignore this entry if no_dump() returns true + */ + if (no_dump(jcr, ff_pkt)) { + Dmsg1(100, "'%s' ignored (NODUMP flag set)\n", + ff_pkt->fname); + return 1; + } + /* * If this is an Incremental backup, see if file was modified * since our last "save_time", presumably the last Full save diff --git a/bacula/technotes-2.5 b/bacula/technotes-2.5 index 9943796db4..f51916e81e 100644 --- a/bacula/technotes-2.5 +++ b/bacula/technotes-2.5 @@ -34,15 +34,21 @@ Allow Mixed Priorities Eliminated license problems with OpenSSL. Code to be completed before 3.0.0 is released: -1. Fix bug #1221 problem with NODUMP flag +*1. Fix bug #1221 problem with NODUMP flag 2. Fix Exchange plugin bugs 1234,1235,1236,1237 + *1234 fixed. 3. Resolve bug #1227 4. Finish documentation (some noted above) -5. Diff 2.4.4 to current SVN and check differences +*5. Diff 2.4.4 to current SVN and check differences General: 15Mar09 +jh Fix by James Harper to print error code when attempting to + restore two databases (only one is permitted). This responds + to bug #1234. +kes Apply the nodump patch supplied by Frank Kardel that fixes + the NODUMP flag problem. This fixes bug #1221 kes Add more output if a user attempts to clone a job but does not uniquely specify the Job name. This responds to bug #1248 which was not a bug, but improves user feedback. -- 2.39.5