From 7db9e99fe4b7185a4ced26bac505ec4a570b96b7 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Wed, 14 Jun 2006 13:06:41 +0000 Subject: [PATCH] - Remove xpg4 lib from FreeBSD build as it is no longer needed and sometimes creates install problems. - Change a couple of %T in strftime to %H:%M:%S as seen in Robert Nelson's code. More to do. - Convert a few store_bit to store_bool in filed_conf.c. - DVD tweak to block.c as supplied by Uwe Muessel. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3061 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/ChangeLog | 120 ++++++++++++++++++++++++++- bacula/ReleaseNotes | 152 +++++++++++++++++++++++++++++----- bacula/autoconf/aclocal.m4 | 2 +- bacula/autoconf/configure.in | 2 - bacula/configure | 78 ++--------------- bacula/kes-1.38 | 10 +++ bacula/kes-1.39 | 7 ++ bacula/src/cats/sql_update.c | 10 +-- bacula/src/dird/job.c | 3 - bacula/src/filed/acl.c | 64 +++++++++++++- bacula/src/filed/filed_conf.c | 16 ++-- bacula/src/filed/filed_conf.h | 16 ++-- bacula/src/filed/restore.c | 1 + bacula/src/findlib/find_one.c | 6 +- bacula/src/jcr.h | 1 + bacula/src/lib/bpipe.c | 20 ++--- bacula/src/lib/bsnprintf.c | 1 + bacula/src/lib/res.c | 2 +- bacula/src/stored/block.c | 11 ++- bacula/src/stored/dev.c | 19 +++-- 20 files changed, 389 insertions(+), 152 deletions(-) diff --git a/bacula/ChangeLog b/bacula/ChangeLog index c9ac5ab043..98177f3ac0 100644 --- a/bacula/ChangeLog +++ b/bacula/ChangeLog @@ -1,4 +1,120 @@ +Release 1.38.10 (08Jun06) released 12JunO6 +08Jun06 +- Modify setting ACLs to suppress error message if the file is a + symbolic link since the file linked to may not yet be created, + and symbolic links really should not have attributes ... +06Jun06 +- Complete implementation of acl.c error message during restore. + During backups, errors getting acls are silently ignored, as was + previously the case. +04Jun06 +- Modify configure.in to check for typeof(). +- Better detection of postgresql installation if pg_conf works. +- Fix RescheduleTimes = 0 bug (should not reschedule). +- Down port from 1.39: fixes for reload, autochanger error messages, + scheduler fixes for reload and day light savings change, +01Jun06 +- Implement partial error messages for src/filed/acl.c +- Fix return code to fail when doing update barcodes and + Pool resource is not found. This previously caused Volumes + to be labeled as cleaning tapes. +- Small updates to projects file. +26May06 +- Prevent DVD code from rewriting label if the device cannot be + opened read/write. +- Used __GNUC__ to detect GNU g++ as suggested by John Goerzen to + fix Debian build bug. +- Fix Dir/SD run race in migrate.c, verify.c, and restore.c +- Update projects file. +24May06 +- Applied patch posted by Jaime Ventura to bug #570 to correct failure + of restarted jobs to complete (due to a destroyed pthreads conditional + variable used by the message thread). +- Fixed bug #619 where Bacula would not restart jobs with MaxRestartTimes + set to zero. +- Apply patch from John Goerzen bug #611 to fix bad manual links in the code. +- Apply patch from Rudolf Cejka bug #614 to removed trailing + colons in query.sql file. +- Apply patch from Rudolf Cejka bug #613 to correct prunning of files + not to create orphans. +- Apply patch from Rudolf Cejka bug #617 to use mtime instead of ctime + in restore long listing. +- Apply patch from Rudolf Cejka bug #609 to use MarkId in verify.c instead + of incorrect MarkedId. +- Apply patch from adioso bug #616 to correct text in manual (replace + Director with File daemon). +21May06 +- Move DIR "run" command to SD before starting the message thread + as suggested by Cristopher Hull to avoid a race deadlock from + two threads using the bsock structure. +- Modify LICENSE to correct some problems pointed out by Debian. +05May06 +- Correct EOF with no \n lex.c problem. +- Add additional INFO messages if autochanger cannot be used. +- Add Eric Bollengier's lex error handler fix, which corrects most + of the reload problems. + +Release 1.38.9 (02May06) +02May06 +- Added code to strip backslashes from Windows filenames during + a restore. +- Corrected Win32 License to use the correct LICENSE file. +- Corrected the buffer count and bytes reported in the heap + statistics. +26Apr06 +- Implement an NT_() macro to indicate that text should NOT + be translated. +- Fix a number of incorrect strings marked for translation, when + they should not be (e.g. commands). +- Fix StartTime bug reported for ClientRunBeforeJob and RunBeforeJob + Patches supplied by user in bugs #608 and #599. +- Use most recent of st_ctime and st_mtime in restore tree DIR + listing. This fixes some problems with Win32 printing incorrect + values. +- Correct the clock shift comm time calculation between the DIR + and the FD. It was added rather than subtracted. +- Strip all backslashes in filenames to be restored on Win32 + machines -- the names should all be in Unix format, and if + there are any backslashes it is most likely due to an improper + FileSet definition, and the files will not otherwise be + restorable. +- Remove lib/regex.c (replaced by bregex.c). +- Delete src/win32/License.txt +- Modify installer to install LICENSE +25Apr06 +- Add back ua_label barcode fix from Rufolf Cejka. +23Apr06 +- Add 'Dir Status' button to the gnome console. +- Display heap stats in Storage daemon without debug level. +22Apr06 +- Integrate most of the MinGW changes -- more to do. +21Apr06 +- Implement using pg_config for finding PostgreSQL files. + Fixes bug #600. Patch supplied by user. +- Remove -t option from mktemp in mtx_changer.in and use + working directory. Fixes bug #578. +- Update job start time after the any run before job so that + files created by the script are only backed up once. Fixes + bug #599. +- Strip trailing newline only from filenames entered in + the restore command when reading a file. This permits + the user to enter filenames with trailing spaces. Fixes + bug #549. The user supplied a patch that I modified slightly. +- Use the most recent time (st_mtime, st_ctime) in the dir + command in restore. This gives the user a better idea of what + the newest file really is. This fixes bug #574. The fix + was suggested by the user. +18Apr06 +- Remove the -f option from the chown in Makefile.in for more + portability. +- Change setting the group in Makefile.in to use chgrp for + more portability. +- Implement a Bacula read/write lock for Python rather + than using the Python lock to avoid recursive problems. +- Correct the uninstall directory names in filed/Makefile.in + as reported by a user. + Release 1.38.8 (14Apr06) 14Apr06 - Correct Makefile for Solaris /bin/sh @@ -446,9 +562,9 @@ Changes to 1.38.1: 15 November 2005 - Fix copyright date and URL typo -- bug #468. - Change autostart install for FreeBSD to look for rc.conf rather than rc.local as suggested fix for bug #466. -- Apply patch supplied by Eric Bollengier to fix PostgreSQL +- Apply patch supplied by Eric Bollinger to fix PostgreSQL grant on status. Bug #465 -- Apply patch supplied by Eric Bollengier to fix PostgreSQL +- Apply patch supplied by Eric Bollinger to fix PostgreSQL update script. Bug #464 - Fix off by one for last Slot of autochanger for label. - Update release date. diff --git a/bacula/ReleaseNotes b/bacula/ReleaseNotes index 5d6c079313..68ab6875ce 100644 --- a/bacula/ReleaseNotes +++ b/bacula/ReleaseNotes @@ -1,23 +1,9 @@ - Release Notes for Bacula 1.38.8 + Release Notes for Bacula 1.38.10 - Bacula code: Total files = 419 Total lines = 137,078 (*.h *.c *.in) - 20,440 additional lines of code since version 1.36.3 + Bacula code: Total files = 423 Total lines = 139,479 (*.h *.c *.in) -!!!! Important !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - In Bacula version 1.38.5 and prior, there was apparently a - compiler bug that caused the Storage daemon to seg fault. - I have applied a workaround in version 1.38.6 and greater that - seems to work. If you experience problems, follow the instructions - below. - - If you are compiling for a 64 bit machine, you need to ensure - that the code is compiled with the -O0 (- oh zero) option otherwise - the SD will crash on most all operations -- apparently due to - a compiler bug in gcc's 64 bit code generation. -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -Warning: +Warning for version 1.38.8 and greater: - The Windows FD no longer automatically folds the case in wild-card comparions. To get the same behavior as before, you must explicitly use "Ignore Case = yes" in your FileSet. @@ -25,9 +11,135 @@ Warning: (typical error for Windows users), unless the string is enclosed in double quotes, in which case, the backslashes must be doubled. -- The new algorithm for selecting Volumes from the Scratch - pool that was implemented in 1.38.6 and 1.38.7 is abandoned - in favor of a corrected version of the 1.38.5 algorithm. + +Major Changes for 1.38.10: +- This is a primarily a bug fix release, with the following bugs being + resolved #570, 609, 611, 613, 614, 617 as well as other bugs not + reported in the bugs database. See below for details. +- The bconsole "reload" command should now work properly in virtually + all situations thanks to the efforts of a number of people (Eric, + Christopher, and myself). +- There is an untested fix to eliminate the scheduling problems (either + no job run or the same job run twice) during sudden clock shifts (daylight + savings time change). +- The manual has been released under the GNU Free Documentation License (FDL). + The major difference is that this removes the prior restriction on + commercial reproduction of the manual. +- Fixed a race condition (thanks to Christopher) on dual processor machines + that caused jobs to block when starting with the SD. + +New features for 1.38.10: +- None + +Fixes for 1.38.10: +08Jun06 +- Modify setting ACLs to suppress error message if the file is a + symbolic link since the file linked to may not yet be created, + and symbolic links really should not have attributes ... +06Jun06 +- Complete implementation of acl.c error message during restore. + During backups, errors getting acls are silently ignored, as was + previously the case. +04Jun06 +- Modify configure.in to check for typeof(). +- Better detection of postgresql installation if pg_conf works. +- Fix RescheduleTimes = 0 bug (should not reschedule). +- Down port from 1.39: fixes for reload, autochanger error messages, + scheduler fixes for reload and day light savings change, +01Jun06 +- Implement partial error messages for src/filed/acl.c +- Fix return code to fail when doing update barcodes and + Pool resource is not found. This previously caused Volumes + to be labeled as cleaning tapes. +- Small updates to projects file. +26May06 +- Prevent DVD code from rewriting label if the device cannot be + opened read/write. +- Fix Dir/SD run race in migrate.c, verify.c, and restore.c +- Update projects file. +24May06 +- Applied patch posted by Jaime Ventura to bug #570 to correct failure + of restarted jobs to complete (due to a destroyed pthreads conditional + variable used by the message thread). +- Fixed bug #619 where Bacula would not restart jobs with MaxRestartTimes + set to zero. +- Apply patch from John Goerzen bug #611 to fix bad manual links in the code. +- Apply patch from Rudolf Cejka bug #614 to removed trailing + colons in query.sql file. +- Apply patch from Rudolf Cejka bug #613 to correct prunning of files + not to create orphans. +- Apply patch from Rudolf Cejka bug #617 to use mtime instead of ctime + in restore long listing. +- Apply patch from Rudolf Cejka bug #609 to use MarkId in verify.c instead + of incorrect MarkedId. +- Apply patch from adioso bug #616 to correct text in manual (replace + Director with File daemon). +21May06 +- Move DIR "run" command to SD before starting the message thread + as suggested by Cristopher Hull to avoid a race deadlock from + two threads using the bsock structure. +- Modify LICENSE to correct some problems pointed out by Debian. +05May06 +- Correct EOF with no \n lex.c problem. +- Add additional INFO messages if autochanger cannot be used. +- Add Eric Bollengier's lex error handler fix, which corrects most + of the reload problems. + + +New features for 1.38.9: +- A "Dir Status" button in the Gnome console. + +Fixes: +This is mainly a bug fix release containing a collection of + minor fixes for 1.38.8. +- Added code to strip backslashes from Windows filenames during + a restore. +- Corrected Win32 License to use the correct LICENSE file. +- Corrected the buffer count and bytes reported in the heap + statistics. +- Fix a number of incorrect strings marked for translation, when + they should not be (e.g. commands). +- Fix StartTime bug reported for ClientRunBeforeJob and RunBeforeJob + Patches supplied by user in bugs #608 and #599. +- Use most recent of st_ctime and st_mtime in restore tree DIR + listing. This fixes some problems with Win32 printing incorrect + values. +- Correct the clock shift comm time calculation between the DIR + and the FD. It was added rather than subtracted. +- Strip all backslashes in filenames to be restored on Win32 + machines -- the names should all be in Unix format, and if + there are any backslashes it is most likely due to an improper + FileSet definition, and the files will not otherwise be + restorable. +- Delete src/win32/License.txt +- Modify installer to install LICENSE +- Add back ua_label barcode fix from Rufolf Cejka. +- Add 'Dir Status' button to the gnome console. +- Display heap stats in Storage daemon without debug level. +- Implement using pg_config for finding PostgreSQL files. + Fixes bug #600. Patch supplied by user. +- Remove -t option from mktemp in mtx_changer.in and use + working directory. Fixes bug #578. +- Update job start time after the any run before job so that + files created by the script are only backed up once. Fixes + bug #599. +- Strip trailing newline only from filenames entered in + the restore command when reading a file. This permits + the user to enter filenames with trailing spaces. Fixes + bug #549. The user supplied a patch that I modified slightly. +- Use the most recent time (st_mtime, st_ctime) in the dir + command in restore. This gives the user a better idea of what + the newest file really is. This fixes bug #574. The fix + was suggested by the user. +- Remove the -f option from the chown in Makefile.in for more + portability. +- Change setting the group in Makefile.in to use chgrp for + more portability. +- Implement a Bacula read/write lock for Python rather + than using the Python lock to avoid recursive problems. +- Correct the uninstall directory names in filed/Makefile.in + as reported by a user. + New features for 1.38.8: - Regex, RegexFile, and RegexDir are now implemented in the diff --git a/bacula/autoconf/aclocal.m4 b/bacula/autoconf/aclocal.m4 index 94de0926c6..8458af0159 100644 --- a/bacula/autoconf/aclocal.m4 +++ b/bacula/autoconf/aclocal.m4 @@ -1,4 +1,4 @@ -# generated automatically by aclocal 1.9.5 -*- Autoconf -*- +# generated automatically by aclocal 1.9.6 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005 Free Software Foundation, Inc. diff --git a/bacula/autoconf/configure.in b/bacula/autoconf/configure.in index d033b15fe5..3f5beaf6ce 100644 --- a/bacula/autoconf/configure.in +++ b/bacula/autoconf/configure.in @@ -1586,8 +1586,6 @@ AC_FUNC_SETPGRP dnl check for BSD setpgrp. # AC_FUNC_FNMATCH dnl use local version -dnl# FreeBSD needs to link libxpg4 -AC_CHECK_LIB(xpg4, setlocale, [LIBS="$LIBS -lxpg4"]) AC_CHECK_LIB(intl, gettext, [LIBS="$LIBS -lintl"]) diff --git a/bacula/configure b/bacula/configure index 280fdce058..a6fdcf44b6 100755 --- a/bacula/configure +++ b/bacula/configure @@ -17535,7 +17535,7 @@ ac_x_header_dirs=' /usr/openwin/share/include' if test "$ac_x_includes" = no; then - # Guess where to find include files, by looking for Intrinsic.h. + # Guess where to find include files, by looking for Xlib.h. # First, try using that file with no special directory specified. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -17543,7 +17543,7 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 @@ -17570,7 +17570,7 @@ else sed 's/^/| /' conftest.$ac_ext >&5 for ac_dir in $ac_x_header_dirs; do - if test -r "$ac_dir/X11/Intrinsic.h"; then + if test -r "$ac_dir/X11/Xlib.h"; then ac_x_includes=$ac_dir break fi @@ -17591,11 +17591,11 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include int main () { -XtMalloc (0) +XrmInitialize () ; return 0; } @@ -28461,74 +28461,6 @@ fi # AC_FUNC_FNMATCH dnl use local version -echo "$as_me:$LINENO: checking for setlocale in -lxpg4" >&5 -echo $ECHO_N "checking for setlocale in -lxpg4... $ECHO_C" >&6 -if test "${ac_cv_lib_xpg4_setlocale+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lxpg4 $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char setlocale (); -int -main () -{ -setlocale (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_xpg4_setlocale=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_xpg4_setlocale=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_xpg4_setlocale" >&5 -echo "${ECHO_T}$ac_cv_lib_xpg4_setlocale" >&6 -if test $ac_cv_lib_xpg4_setlocale = yes; then - LIBS="$LIBS -lxpg4" -fi - echo "$as_me:$LINENO: checking for gettext in -lintl" >&5 echo $ECHO_N "checking for gettext in -lintl... $ECHO_C" >&6 if test "${ac_cv_lib_intl_gettext+set}" = set; then diff --git a/bacula/kes-1.38 b/bacula/kes-1.38 index 99803cb71d..12632bacd6 100644 --- a/bacula/kes-1.38 +++ b/bacula/kes-1.38 @@ -2,6 +2,16 @@ Kern Sibbald General: +Release 1.38.10 (08Jun06) released 12JunO6 +08Jun06 +- Modify setting ACLs to suppress error message if the file is a + symbolic link since the file linked to may not yet be created, + and symbolic links really should not have attributes ... +- Remove old regex code from baconfig.h +06Jun06 +- Complete implementation of acl.c error message during restore. + During backups, errors getting acls are silently ignored, as was + previously the case. 04Jun06 - Modify configure.in to check for typeof(). - Better detection of postgresql installation if pg_conf works. diff --git a/bacula/kes-1.39 b/bacula/kes-1.39 index 2bb7f94465..d01f665beb 100644 --- a/bacula/kes-1.39 +++ b/bacula/kes-1.39 @@ -2,6 +2,13 @@ Kern Sibbald General: +14Jun06 +- Remove xpg4 lib from FreeBSD build as it is no longer needed and + sometimes creates install problems. +- Change a couple of %T in strftime to %H:%M:%S as seen in Robert + Nelson's code. More to do. +- Convert a few store_bit to store_bool in filed_conf.c. +- DVD tweak to block.c as supplied by Uwe Muessel. 04Jun06 - Modify configure.in to check for typeof(). - In findlib/attribs.c use typeof instead of templates if possible. diff --git a/bacula/src/cats/sql_update.c b/bacula/src/cats/sql_update.c index 7829cdd7ff..e757bdcdaa 100644 --- a/bacula/src/cats/sql_update.c +++ b/bacula/src/cats/sql_update.c @@ -97,7 +97,7 @@ db_update_job_start_record(JCR *jcr, B_DB *mdb, JOB_DBR *jr) stime = jr->StartTime; localtime_r(&stime, &tm); - strftime(dt, sizeof(dt), "%Y-%m-%d %T", &tm); + strftime(dt, sizeof(dt), "%Y-%m-%d %H:%M:%S", &tm); JobTDate = (btime_t)stime; db_lock(mdb); @@ -153,7 +153,7 @@ db_update_job_end_record(JCR *jcr, B_DB *mdb, JOB_DBR *jr) ttime = jr->EndTime; localtime_r(&ttime, &tm); - strftime(dt, sizeof(dt), "%Y-%m-%d %T", &tm); + strftime(dt, sizeof(dt), "%Y-%m-%d %H:%M:%S", &tm); JobTDate = ttime; db_lock(mdb); @@ -296,7 +296,7 @@ db_update_media_record(JCR *jcr, B_DB *mdb, MEDIA_DBR *mr) Dmsg1(400, "Set FirstWritten Vol=%s\n", mr->VolumeName); ttime = mr->FirstWritten; localtime_r(&ttime, &tm); - strftime(dt, sizeof(dt), "%Y-%m-%d %T", &tm); + strftime(dt, sizeof(dt), "%Y-%m-%d %H:%M:%S", &tm); Mmsg(mdb->cmd, "UPDATE Media SET FirstWritten='%s'" " WHERE VolumeName='%s'", dt, mr->VolumeName); stat = UPDATE_DB(jcr, mdb, mdb->cmd); @@ -310,7 +310,7 @@ db_update_media_record(JCR *jcr, B_DB *mdb, MEDIA_DBR *mr) ttime = time(NULL); } localtime_r(&ttime, &tm); - strftime(dt, sizeof(dt), "%Y-%m-%d %T", &tm); + strftime(dt, sizeof(dt), "%Y-%m-%d %H:%M:%S", &tm); Mmsg(mdb->cmd, "UPDATE Media SET LabelDate='%s' " "WHERE VolumeName='%s'", dt, mr->VolumeName); UPDATE_DB(jcr, mdb, mdb->cmd); @@ -319,7 +319,7 @@ db_update_media_record(JCR *jcr, B_DB *mdb, MEDIA_DBR *mr) if (mr->LastWritten != 0) { ttime = mr->LastWritten; localtime_r(&ttime, &tm); - strftime(dt, sizeof(dt), "%Y-%m-%d %T", &tm); + strftime(dt, sizeof(dt), "%Y-%m-%d %H:%M:%S", &tm); Mmsg(mdb->cmd, "UPDATE Media Set LastWritten='%s' " "WHERE VolumeName='%s'", dt, mr->VolumeName); UPDATE_DB(jcr, mdb, mdb->cmd); diff --git a/bacula/src/dird/job.c b/bacula/src/dird/job.c index 670270b7c8..111691631b 100644 --- a/bacula/src/dird/job.c +++ b/bacula/src/dird/job.c @@ -247,9 +247,7 @@ static void *job_thread(void *arg) if (job_canceled(jcr)) { update_job_end_record(jcr); - } else { - /* Run any script BeforeJob on dird */ run_scripts(jcr, jcr->job->RunScripts, "BeforeJob"); @@ -321,7 +319,6 @@ static void *job_thread(void *arg) } } -bail_out: generate_daemon_event(jcr, "JobEnd"); Dmsg1(50, "======== End Job stat=%c ==========\n", jcr->JobStatus); sm_check(__FILE__, __LINE__, true); diff --git a/bacula/src/filed/acl.c b/bacula/src/filed/acl.c index 284b777814..cd72701625 100644 --- a/bacula/src/filed/acl.c +++ b/bacula/src/filed/acl.c @@ -167,6 +167,11 @@ int bacl_get(JCR *jcr, int acltype) acl_free(acl_text); return len; } + berrno be; + Jmsg2(jcr, M_ERROR, 0, _("acl_to_text error on file \"%s\": ERR=%s\n"), + jcr->last_fname, be.strerror()); + Dmsg3(100, "acl_to_text error acl=%s file=%s ERR=%s\n", + jcr->acl_text, jcr->last_fname, be.strerror()); acl_free(acl); #ifndef HAVE_OSF1_OS /* BACL_ENOTSUP not defined for OSF1 */ } else if (errno == BACL_ENOTSUP) { @@ -213,12 +218,21 @@ int bacl_set(JCR *jcr, int acltype) */ #ifndef HAVE_FREEBSD_OS if (acl_valid(acl) != 0) { + berrno be; + Jmsg2(jcr, M_ERROR, 0, _("ac_valid error on file \"%s\": ERR=%s\n"), + jcr->last_fname, be.strerror()); + Dmsg3(100, "acl_valid error acl=%s file=%s ERR=%s\n", + jcr->acl_text, jcr->last_fname, be.strerror()); acl_free(acl); return -1; } #endif - if (acl_set_file(jcr->last_fname, ostype, acl) != 0) { + /* + * Restore the ACLs, but don't complain about links which really should + * not have attributes, and the file it is linked to may not yet be restored. + */ + if (acl_set_file(jcr->last_fname, ostype, acl) != 0 && jcr->last_type != FT_LNK) { berrno be; Jmsg2(jcr, M_ERROR, 0, _("acl_set_file error on file \"%s\": ERR=%s\n"), jcr->last_fname, be.strerror()); @@ -253,6 +267,12 @@ int bacl_get(JCR *jcr, int acltype) actuallyfree(acl_text); return len; } + berrno be; + Jmsg2(jcr, M_ERROR, 0, _("acltostr error on file \"%s\": ERR=%s\n"), + jcr->last_fname, be.strerror()); + Dmsg3(100, "acltostr error acl=%s file=%s ERR=%s\n", + jcr->acl_text, jcr->last_fname, be.strerror()); + return -1; } return -1; } @@ -264,12 +284,31 @@ int bacl_set(JCR *jcr, int acltype) n = strtoacl(jcr->acl_text, 0, NACLENTRIES, acls, ACL_FILEOWNER, ACL_FILEGROUP); if (n <= 0) { + berrno be; + Jmsg2(jcr, M_ERROR, 0, _("strtoacl error on file \"%s\": ERR=%s\n"), + jcr->last_fname, be.strerror()); + Dmsg3(100, "strtoacl error acl=%s file=%s ERR=%s\n", + jcr->acl_text, jcr->last_fname, be.strerror()); return -1; } if (strtoacl(jcr->acl_text, n, NACLENTRIES, acls, ACL_FILEOWNER, ACL_FILEGROUP) != n) { + berrno be; + Jmsg2(jcr, M_ERROR, 0, _("strtoacl error on file \"%s\": ERR=%s\n"), + jcr->last_fname, be.strerror()); + Dmsg3(100, "strtoacl error acl=%s file=%s ERR=%s\n", + jcr->acl_text, jcr->last_fname, be.strerror()); return -1; } - if (setacl(jcr->last_fname, n, acls) != 0) { + /* + * Restore the ACLs, but don't complain about links which really should + * not have attributes, and the file it is linked to may not yet be restored. + */ + if (setacl(jcr->last_fname, n, acls) != 0 && jcr->last_type != FT_LNK) { + berrno be; + Jmsg2(jcr, M_ERROR, 0, _("setacl error on file \"%s\": ERR=%s\n"), + jcr->last_fname, be.strerror()); + Dmsg3(100, "setacl error acl=%s file=%s ERR=%s\n", + jcr->acl_text, jcr->last_fname, be.strerror()); return -1; } return 0; @@ -301,6 +340,11 @@ int bacl_get(JCR *jcr, int acltype) free(acls); return len; } + berrno be; + Jmsg2(jcr, M_ERROR, 0, _("acltotext error on file \"%s\": ERR=%s\n"), + jcr->last_fname, be.strerror()); + Dmsg3(100, "acltotext error acl=%s file=%s ERR=%s\n", + jcr->acl_text, jcr->last_fname, be.strerror()); } free(acls); return -1; @@ -313,9 +357,23 @@ int bacl_set(JCR *jcr, int acltype) acls = aclfromtext(jcr->acl_text, &n); if (!acls) { + berrno be; + Jmsg2(jcr, M_ERROR, 0, _("aclfromtext error on file \"%s\": ERR=%s\n"), + jcr->last_fname, be.strerror()); + Dmsg3(100, "aclfromtext error acl=%s file=%s ERR=%s\n", + jcr->acl_text, jcr->last_fname, be.strerror()); return -1; } - if (acl(jcr->last_fname, SETACL, n, acls) == -1) { + /* + * Restore the ACLs, but don't complain about links which really should + * not have attributes, and the file it is linked to may not yet be restored. + */ + if (acl(jcr->last_fname, SETACL, n, acls) == -1 && jcr->last_type != FT_LNK) { + berrno be; + Jmsg2(jcr, M_ERROR, 0, _("acl(SETACL) error on file \"%s\": ERR=%s\n"), + jcr->last_fname, be.strerror()); + Dmsg3(100, "acl(SETACL) error acl=%s file=%s ERR=%s\n", + jcr->acl_text, jcr->last_fname, be.strerror()); actuallyfree(acls); return -1; } diff --git a/bacula/src/filed/filed_conf.c b/bacula/src/filed/filed_conf.c index f01b862d24..a58a8fef66 100644 --- a/bacula/src/filed/filed_conf.c +++ b/bacula/src/filed/filed_conf.c @@ -89,13 +89,13 @@ static RES_ITEM cli_items[] = { {"heartbeatinterval", store_time, ITEM(res_client.heartbeat_interval), 0, ITEM_DEFAULT, 0}, {"sdconnecttimeout", store_time,ITEM(res_client.SDConnectTimeout), 0, ITEM_DEFAULT, 60 * 30}, {"maximumnetworkbuffersize", store_pint, ITEM(res_client.max_network_buffer_size), 0, 0, 0}, - {"pkisignatures", store_bit, ITEM(res_client.pki_sign), 1, ITEM_DEFAULT, 0}, - {"pkiencryption", store_bit, ITEM(res_client.pki_encrypt), 1, ITEM_DEFAULT, 0}, + {"pkisignatures", store_bool, ITEM(res_client.pki_sign), 0, ITEM_DEFAULT, 0}, + {"pkiencryption", store_bool, ITEM(res_client.pki_encrypt), 0, ITEM_DEFAULT, 0}, {"pkikeypair", store_dir, ITEM(res_client.pki_keypair_file), 0, 0, 0}, {"pkisigner", store_alist_str, ITEM(res_client.pki_signing_key_files), 0, 0, 0}, {"pkimasterkey", store_alist_str, ITEM(res_client.pki_master_key_files), 0, 0, 0}, - {"tlsenable", store_bit, ITEM(res_client.tls_enable), 1, 0, 0}, - {"tlsrequire", store_bit, ITEM(res_client.tls_require), 1, 0, 0}, + {"tlsenable", store_bool, ITEM(res_client.tls_enable), 0, 0, 0}, + {"tlsrequire", store_bool, ITEM(res_client.tls_require), 0, 0, 0}, {"tlscacertificatefile", store_dir, ITEM(res_client.tls_ca_certfile), 0, 0, 0}, {"tlscacertificatedir", store_dir, ITEM(res_client.tls_ca_certdir), 0, 0, 0}, {"tlscertificate", store_dir, ITEM(res_client.tls_certfile), 0, 0, 0}, @@ -109,10 +109,10 @@ static RES_ITEM dir_items[] = { {"description", store_str, ITEM(res_dir.hdr.desc), 0, 0, 0}, {"password", store_password, ITEM(res_dir.password), 0, ITEM_REQUIRED, 0}, {"address", store_str, ITEM(res_dir.address), 0, 0, 0}, - {"monitor", store_bit, ITEM(res_dir.monitor), 1, ITEM_DEFAULT, 0}, - {"tlsenable", store_bit, ITEM(res_dir.tls_enable), 1, 0, 0}, - {"tlsrequire", store_bit, ITEM(res_dir.tls_require), 1, 0, 0}, - {"tlsverifypeer", store_bit, ITEM(res_dir.tls_verify_peer), 1, ITEM_DEFAULT, 1}, + {"monitor", store_bool, ITEM(res_dir.monitor), 0, ITEM_DEFAULT, 0}, + {"tlsenable", store_bool, ITEM(res_dir.tls_enable), 0, 0, 0}, + {"tlsrequire", store_bool, ITEM(res_dir.tls_require), 0, 0, 0}, + {"tlsverifypeer", store_bool, ITEM(res_dir.tls_verify_peer), 0, ITEM_DEFAULT, 1}, {"tlscacertificatefile", store_dir, ITEM(res_dir.tls_ca_certfile), 0, 0, 0}, {"tlscacertificatedir", store_dir, ITEM(res_dir.tls_ca_certdir), 0, 0, 0}, {"tlscertificate", store_dir, ITEM(res_dir.tls_certfile), 0, 0, 0}, diff --git a/bacula/src/filed/filed_conf.h b/bacula/src/filed/filed_conf.h index 80354326ee..f9e40e1fd3 100644 --- a/bacula/src/filed/filed_conf.h +++ b/bacula/src/filed/filed_conf.h @@ -45,10 +45,10 @@ struct DIRRES { RES hdr; char *password; /* Director password */ char *address; /* Director address or zero */ - int monitor; /* Have only access to status and .status functions */ - int tls_enable; /* Enable TLS */ - int tls_require; /* Require TLS */ - int tls_verify_peer; /* TLS Verify Client Certificate */ + bool monitor; /* Have only access to status and .status functions */ + bool tls_enable; /* Enable TLS */ + bool tls_require; /* Require TLS */ + bool tls_verify_peer; /* TLS Verify Client Certificate */ char *tls_ca_certfile; /* TLS CA Certificate File */ char *tls_ca_certdir; /* TLS CA Certificate Directory */ char *tls_certfile; /* TLS Server Certificate File */ @@ -71,13 +71,13 @@ struct CLIENT { utime_t heartbeat_interval; /* Interval to send heartbeats to Dir */ utime_t SDConnectTimeout; /* timeout in seconds */ uint32_t max_network_buffer_size; /* max network buf size */ - int pki_sign; /* Enable Data Integrity Verification via Digital Signatures */ - int pki_encrypt; /* Enable Data Encryption */ + bool pki_sign; /* Enable Data Integrity Verification via Digital Signatures */ + bool pki_encrypt; /* Enable Data Encryption */ char *pki_keypair_file; /* PKI Key Pair File */ alist *pki_signing_key_files; /* PKI Signing Key Files */ alist *pki_master_key_files; /* PKI Master Key Files */ - int tls_enable; /* Enable TLS */ - int tls_require; /* Require TLS */ + bool tls_enable; /* Enable TLS */ + bool tls_require; /* Require TLS */ char *tls_ca_certfile; /* TLS CA Certificate File */ char *tls_ca_certdir; /* TLS CA Certificate Directory */ char *tls_certfile; /* TLS Client Certificate File */ diff --git a/bacula/src/filed/restore.c b/bacula/src/filed/restore.c index fc4f3df977..951da3dc9a 100644 --- a/bacula/src/filed/restore.c +++ b/bacula/src/filed/restore.c @@ -315,6 +315,7 @@ void do_restore(JCR *jcr) case CF_CREATED: /* File created, but there is no content */ jcr->lock(); pm_strcpy(jcr->last_fname, attr->ofname); + jcr->last_type = attr->type; jcr->JobFiles++; jcr->unlock(); fileAddr = 0; diff --git a/bacula/src/findlib/find_one.c b/bacula/src/findlib/find_one.c index 75d3e855e9..b4e5831f87 100755 --- a/bacula/src/findlib/find_one.c +++ b/bacula/src/findlib/find_one.c @@ -1,5 +1,5 @@ /* - Copyright (C) 2000-2005 Kern Sibbald + Copyright (C) 2000-2006 Kern Sibbald This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -251,8 +251,8 @@ find_one_file(JCR *jcr, FF_PKT *ff_pkt, struct f_link *lp; if (ff_pkt->linkhash == NULL) { - ff_pkt->linkhash = (link_t **)bmalloc(LINK_HASHTABLE_SIZE * sizeof(link_t *)); - memset(ff_pkt->linkhash, 0, LINK_HASHTABLE_SIZE * sizeof(link_t *)); + ff_pkt->linkhash = (link_t **)bmalloc(LINK_HASHTABLE_SIZE * sizeof(link_t *)); + memset(ff_pkt->linkhash, 0, LINK_HASHTABLE_SIZE * sizeof(link_t *)); } const int linkhash = LINKHASH(ff_pkt->statp); diff --git a/bacula/src/jcr.h b/bacula/src/jcr.h index 39a570820f..f78d2f3cd5 100644 --- a/bacula/src/jcr.h +++ b/bacula/src/jcr.h @@ -234,6 +234,7 @@ public: uint32_t num_files_examined; /* files examined this job */ POOLMEM *last_fname; /* last file saved/verified */ POOLMEM *acl_text; /* text of ACL for backup */ + int last_type; /* type of last file saved/verified */ /*********FIXME********* add missing files and files to be retried */ int incremental; /* set if incremental for SINCE */ time_t mtime; /* begin time for SINCE */ diff --git a/bacula/src/lib/bpipe.c b/bacula/src/lib/bpipe.c index 630edcc265..a28f3650b3 100644 --- a/bacula/src/lib/bpipe.c +++ b/bacula/src/lib/bpipe.c @@ -25,17 +25,17 @@ #include "jcr.h" int execvp_errors[] = { - EACCES, - ENOEXEC, - EFAULT, - EINTR, - E2BIG, - ENAMETOOLONG, - ENOMEM, + EACCES, + ENOEXEC, + EFAULT, + EINTR, + E2BIG, + ENAMETOOLONG, + ENOMEM, #ifndef WIN32 - ETXTBSY, + ETXTBSY, #endif - ENOENT + ENOENT }; int num_execvp_errors = (int)(sizeof(execvp_errors)/sizeof(int)); @@ -237,7 +237,7 @@ int close_bpipe(BPIPE *bpipe) #else #warning "WTERMSIG undefined in Win32 !!!" #endif - Dmsg1(800, "Child died from signale %d\n", stat); + Dmsg1(800, "Child died from signal %d\n", stat); stat |= b_errno_signal; /* exit signal returned */ } } diff --git a/bacula/src/lib/bsnprintf.c b/bacula/src/lib/bsnprintf.c index bd6c2a19d4..57f556df9d 100644 --- a/bacula/src/lib/bsnprintf.c +++ b/bacula/src/lib/bsnprintf.c @@ -75,6 +75,7 @@ static int32_t fmtfp(char *buffer, int32_t currlen, int32_t maxlen, #define DP_C_INT64 4 #define char_to_int(p) ((p)- '0') +#undef MAX #define MAX(p,q) (((p) >= (q)) ? (p) : (q)) /* diff --git a/bacula/src/lib/res.c b/bacula/src/lib/res.c index 83408ba7be..9c6e360100 100644 --- a/bacula/src/lib/res.c +++ b/bacula/src/lib/res.c @@ -7,7 +7,7 @@ * Version $Id$ */ /* - Copyright (C) 2000-2005 Kern Sibbald + Copyright (C) 2000-2006 Kern Sibbald This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/bacula/src/stored/block.c b/bacula/src/stored/block.c index d9320e3e2e..2917c0fb73 100644 --- a/bacula/src/stored/block.c +++ b/bacula/src/stored/block.c @@ -910,13 +910,12 @@ reread: Dmsg3(100, "Tests : %d %d %d\n", (dev->VolCatInfo.VolCatParts > 0), ((dev->file_addr-dev->part_start) == dev->part_size), (dev->part <= dev->VolCatInfo.VolCatParts));*/ - /* Check for part file end */ - if ((dev->num_parts > 0) && - ((dev->file_addr-dev->part_start) == dev->part_size) && - (dev->part < dev->num_parts)) { + /* Check for DVD part file end */ + if (dev->at_eof() && dev->is_dvd() && dev->num_parts > 0 && + dev->part < dev->num_parts) { if (dvd_open_next_part(dcr) < 0) { - Jmsg2(dcr->jcr, M_FATAL, 0, _("Unable to open device next part %s: ERR=%s\n"), - dev->print_name(), dev->bstrerror()); + Jmsg3(dcr->jcr, M_FATAL, 0, _("Unable to open device part=%d %s: ERR=%s\n"), + dev->part, dev->print_name(), dev->bstrerror()); dev->dev_errno = EIO; return false; } diff --git a/bacula/src/stored/dev.c b/bacula/src/stored/dev.c index 39bd3e5e50..7d59e9dc94 100644 --- a/bacula/src/stored/dev.c +++ b/bacula/src/stored/dev.c @@ -781,7 +781,7 @@ bool DEVICE::eod() if (at_eot()) { return true; } - state &= ~(ST_EOF); /* remove EOF flags */ + clear_eof(); /* remove EOF flag */ block_num = file = 0; file_size = 0; file_addr = 0; @@ -793,7 +793,7 @@ bool DEVICE::eod() // Dmsg1(100, "====== Seek to %lld\n", pos); if (pos >= 0) { update_pos_dev(this); - state |= ST_EOT; + set_eot(); return true; } dev_errno = errno; @@ -1283,10 +1283,12 @@ bool DEVICE::fsf(int num) } update_pos_dev(this); Dmsg1(200, "Return %d from FSF\n", stat); - if (at_eof()) + if (at_eof()) { Dmsg0(200, "ST_EOF set on exit FSF\n"); - if (at_eot()) + } + if (at_eot()) { Dmsg0(200, "ST_EOT set on exit FSF\n"); + } Dmsg1(200, "Return from FSF file=%d\n", file); return stat == 0; } @@ -1314,7 +1316,8 @@ bool DEVICE::bsf(int num) return false; } Dmsg0(29, "bsf\n"); - state &= ~(ST_EOT|ST_EOF); + clear_eot(); + clear_eof(); file -= num; file_addr = 0; file_size = 0; @@ -1416,7 +1419,8 @@ bool DEVICE::bsr(int num) Dmsg0(29, "bsr_dev\n"); block_num -= num; - state &= ~(ST_EOF|ST_EOT|ST_EOF); + clear_eof(); + clear_eot(); mt_com.mt_op = MTBSR; mt_com.mt_count = num; stat = ioctl(fd, MTIOCTOP, (char *)&mt_com); @@ -1521,7 +1525,8 @@ bool DEVICE::weof(int num) return false; } - state &= ~(ST_EOT | ST_EOF); /* remove EOF/EOT flags */ + clear_eof(); + clear_eot(); mt_com.mt_op = MTWEOF; mt_com.mt_count = num; stat = ioctl(fd, MTIOCTOP, (char *)&mt_com); -- 2.39.5