From a38a3fd0b18d6d8fb5aaa6b868fa5fc6a6f5fa2f Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Wed, 25 Apr 2007 13:43:25 +0000 Subject: [PATCH] Insure that bat.conf is not overwritten during installation. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4631 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/autoconf/config.h.in | 6 +++--- bacula/autoconf/configure.in | 3 +++ bacula/configure | 5 ++++- bacula/src/qt-console/install_conf_file.in | 15 +++++++++++++++ bacula/src/stored/stored.h | 2 +- bacula/technotes-2.1 | 3 ++- 6 files changed, 28 insertions(+), 6 deletions(-) create mode 100755 bacula/src/qt-console/install_conf_file.in diff --git a/bacula/autoconf/config.h.in b/bacula/autoconf/config.h.in index 9ca7d391dd..34bca4c309 100644 --- a/bacula/autoconf/config.h.in +++ b/bacula/autoconf/config.h.in @@ -817,9 +817,9 @@ /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at runtime. - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown */ + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION /* Define to 1 if the `S_IS*' macros in do not work properly. */ diff --git a/bacula/autoconf/configure.in b/bacula/autoconf/configure.in index e1f6607585..1c43f0fd55 100644 --- a/bacula/autoconf/configure.in +++ b/bacula/autoconf/configure.in @@ -2047,6 +2047,7 @@ AC_OUTPUT([autoconf/Make.common \ src/gnome2-console/bgnome-console.conf \ src/qt-console/bat.conf \ src/qt-console/bat.pro \ + src/qt-console/install_conf_file \ src/wx-console/Makefile \ src/wx-console/bwx-console.conf \ src/tray-monitor/Makefile \ @@ -2138,6 +2139,8 @@ chmod 755 $c/mysql chmod 755 src/win32/build-depkgs-mingw32 +chmod 755 src/qt-console/install_conf_file + if test "x$ac_cv_sys_largefile_CFLAGS" != "xno" ; then largefile_support="yes" fi diff --git a/bacula/configure b/bacula/configure index 2f29990584..bcba46b0d3 100755 --- a/bacula/configure +++ b/bacula/configure @@ -33963,7 +33963,7 @@ if test "x${subsysdir}" = "x${sbindir}" ; then exit 1 fi -ac_config_files="$ac_config_files autoconf/Make.common Makefile manpages/Makefile scripts/startmysql scripts/stopmysql scripts/btraceback scripts/startit scripts/stopit scripts/bconsole scripts/gconsole scripts/bacula scripts/bacula-ctl-dir scripts/bacula-ctl-fd scripts/bacula-ctl-sd scripts/devel_bacula scripts/Makefile scripts/logrotate scripts/bacula.desktop.gnome1 scripts/bacula.desktop.gnome2 scripts/bacula.desktop.gnome1.consolehelper scripts/bacula.desktop.gnome2.consolehelper scripts/bacula.desktop.gnome1.xsu scripts/bacula.desktop.gnome2.xsu scripts/bgnome-console.console_apps scripts/mtx-changer scripts/disk-changer scripts/dvd-handler scripts/dvd-simulator scripts/bacula-tray-monitor.desktop scripts/logwatch/Makefile scripts/logwatch/logfile.bacula.conf scripts/wxconsole.console_apps scripts/wxconsole.desktop.consolehelper scripts/wxconsole.desktop.xsu src/Makefile src/host.h src/console/Makefile src/console/bconsole.conf src/gnome2-console/Makefile src/gnome2-console/bgnome-console.conf src/qt-console/bat.conf src/qt-console/bat.pro src/wx-console/Makefile src/wx-console/bwx-console.conf src/tray-monitor/Makefile src/tray-monitor/tray-monitor.conf src/dird/Makefile src/dird/bacula-dir.conf src/lib/Makefile src/stored/Makefile src/stored/bacula-sd.conf src/filed/Makefile src/filed/bacula-fd.conf src/cats/Makefile src/cats/make_catalog_backup src/cats/delete_catalog_backup src/cats/create_postgresql_database src/cats/update_postgresql_tables src/cats/make_postgresql_tables src/cats/grant_postgresql_privileges src/cats/drop_postgresql_tables src/cats/drop_postgresql_database src/cats/create_mysql_database src/cats/update_mysql_tables src/cats/make_mysql_tables src/cats/grant_mysql_privileges src/cats/drop_mysql_tables src/cats/drop_mysql_database src/cats/create_sqlite_database src/cats/update_sqlite_tables src/cats/make_sqlite_tables src/cats/grant_sqlite_privileges src/cats/drop_sqlite_tables src/cats/drop_sqlite_database src/cats/create_sqlite3_database src/cats/update_sqlite3_tables src/cats/make_sqlite3_tables src/cats/grant_sqlite3_privileges src/cats/drop_sqlite3_tables src/cats/drop_sqlite3_database src/cats/sqlite src/cats/mysql src/cats/create_bdb_database src/cats/update_bdb_tables src/cats/make_bdb_tables src/cats/grant_bdb_privileges src/cats/drop_bdb_tables src/cats/drop_bdb_database src/cats/create_bacula_database src/cats/update_bacula_tables src/cats/grant_bacula_privileges src/cats/make_bacula_tables src/cats/drop_bacula_tables src/cats/drop_bacula_database src/findlib/Makefile src/tools/Makefile po/Makefile.in $PFILES" +ac_config_files="$ac_config_files autoconf/Make.common Makefile manpages/Makefile scripts/startmysql scripts/stopmysql scripts/btraceback scripts/startit scripts/stopit scripts/bconsole scripts/gconsole scripts/bacula scripts/bacula-ctl-dir scripts/bacula-ctl-fd scripts/bacula-ctl-sd scripts/devel_bacula scripts/Makefile scripts/logrotate scripts/bacula.desktop.gnome1 scripts/bacula.desktop.gnome2 scripts/bacula.desktop.gnome1.consolehelper scripts/bacula.desktop.gnome2.consolehelper scripts/bacula.desktop.gnome1.xsu scripts/bacula.desktop.gnome2.xsu scripts/bgnome-console.console_apps scripts/mtx-changer scripts/disk-changer scripts/dvd-handler scripts/dvd-simulator scripts/bacula-tray-monitor.desktop scripts/logwatch/Makefile scripts/logwatch/logfile.bacula.conf scripts/wxconsole.console_apps scripts/wxconsole.desktop.consolehelper scripts/wxconsole.desktop.xsu src/Makefile src/host.h src/console/Makefile src/console/bconsole.conf src/gnome2-console/Makefile src/gnome2-console/bgnome-console.conf src/qt-console/bat.conf src/qt-console/bat.pro src/qt-console/install_conf_file src/wx-console/Makefile src/wx-console/bwx-console.conf src/tray-monitor/Makefile src/tray-monitor/tray-monitor.conf src/dird/Makefile src/dird/bacula-dir.conf src/lib/Makefile src/stored/Makefile src/stored/bacula-sd.conf src/filed/Makefile src/filed/bacula-fd.conf src/cats/Makefile src/cats/make_catalog_backup src/cats/delete_catalog_backup src/cats/create_postgresql_database src/cats/update_postgresql_tables src/cats/make_postgresql_tables src/cats/grant_postgresql_privileges src/cats/drop_postgresql_tables src/cats/drop_postgresql_database src/cats/create_mysql_database src/cats/update_mysql_tables src/cats/make_mysql_tables src/cats/grant_mysql_privileges src/cats/drop_mysql_tables src/cats/drop_mysql_database src/cats/create_sqlite_database src/cats/update_sqlite_tables src/cats/make_sqlite_tables src/cats/grant_sqlite_privileges src/cats/drop_sqlite_tables src/cats/drop_sqlite_database src/cats/create_sqlite3_database src/cats/update_sqlite3_tables src/cats/make_sqlite3_tables src/cats/grant_sqlite3_privileges src/cats/drop_sqlite3_tables src/cats/drop_sqlite3_database src/cats/sqlite src/cats/mysql src/cats/create_bdb_database src/cats/update_bdb_tables src/cats/make_bdb_tables src/cats/grant_bdb_privileges src/cats/drop_bdb_tables src/cats/drop_bdb_database src/cats/create_bacula_database src/cats/update_bacula_tables src/cats/grant_bacula_privileges src/cats/make_bacula_tables src/cats/drop_bacula_tables src/cats/drop_bacula_database src/findlib/Makefile src/tools/Makefile po/Makefile.in $PFILES" ac_config_commands="$ac_config_commands default" @@ -34566,6 +34566,7 @@ do "src/gnome2-console/bgnome-console.conf") CONFIG_FILES="$CONFIG_FILES src/gnome2-console/bgnome-console.conf" ;; "src/qt-console/bat.conf") CONFIG_FILES="$CONFIG_FILES src/qt-console/bat.conf" ;; "src/qt-console/bat.pro") CONFIG_FILES="$CONFIG_FILES src/qt-console/bat.pro" ;; + "src/qt-console/install_conf_file") CONFIG_FILES="$CONFIG_FILES src/qt-console/install_conf_file" ;; "src/wx-console/Makefile") CONFIG_FILES="$CONFIG_FILES src/wx-console/Makefile" ;; "src/wx-console/bwx-console.conf") CONFIG_FILES="$CONFIG_FILES src/wx-console/bwx-console.conf" ;; "src/tray-monitor/Makefile") CONFIG_FILES="$CONFIG_FILES src/tray-monitor/Makefile" ;; @@ -35599,6 +35600,8 @@ chmod 755 $c/mysql chmod 755 src/win32/build-depkgs-mingw32 +chmod 755 src/qt-console/install_conf_file + if test "x$ac_cv_sys_largefile_CFLAGS" != "xno" ; then largefile_support="yes" fi diff --git a/bacula/src/qt-console/install_conf_file.in b/bacula/src/qt-console/install_conf_file.in new file mode 100755 index 0000000000..e4a3b005f4 --- /dev/null +++ b/bacula/src/qt-console/install_conf_file.in @@ -0,0 +1,15 @@ +#!/bin/sh + +sbindir=@sbindir@ +sysconfdir=@sysconfdir@ +INSTALL_CONFIG="@INSTALL@ -m 640" + +srcconf=bat.conf +if test -f ${DESTDIR}${sysconfdir}/${srcconf}; then + destconf=${srcconf}.new + echo " ==> Found existing $srcconf, installing new conf file as ${destconf}" +else + destconf=${srcconf} +fi +echo "${INSTALL_CONFIG} ${srcconf} ${DESTDIR}${sysconfdir}/${destconf}" +${INSTALL_CONFIG} ${srcconf} ${DESTDIR}${sysconfdir}/${destconf} diff --git a/bacula/src/stored/stored.h b/bacula/src/stored/stored.h index a530d9a2a5..7516a7e9ea 100644 --- a/bacula/src/stored/stored.h +++ b/bacula/src/stored/stored.h @@ -37,7 +37,7 @@ #define STORAGE_DAEMON 1 /* Set to debug mutexes */ -#define SD_DEBUG_LOCK +//#define SD_DEBUG_LOCK const int sd_dbglvl = 100; #ifdef HAVE_MTIO_H diff --git a/bacula/technotes-2.1 b/bacula/technotes-2.1 index 71f3de66c8..ff53aaa2bb 100644 --- a/bacula/technotes-2.1 +++ b/bacula/technotes-2.1 @@ -2,6 +2,7 @@ General: 25Apr07 +kes Insure that bat.conf is not overwritten during installation. kes Fix important bug in db_sql_query() in mysql.c. It was introduced while I was implementing migration in March 2006 ! 24Apr07 @@ -109,7 +110,7 @@ kes Correct migration prune SQL typo that crept in in a 01Apr07 kes Move bnet_despool() into class in bsock.c kes Modify job report to include director name and Build OS. -kes Move drop and check_catalog() before fork. +kes Move drop root privilege and check_catalog() before fork. kes Add update database scripts (version 9 to 10) to updatedb directory. 31Mar07 ebl Check size and age of each file after its backup to see if -- 2.39.5