From be65b971312f8ca3c88db9a3d204ec01fcedefe0 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Thu, 19 Jun 2008 19:44:34 +0000 Subject: [PATCH] kes Add dbuser to DIR conf file (replaces user). kes Add --with-db-password to ./configure kes Fix regress to handle db_password. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/branches/Branch-2.4@7187 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/autoconf/configure.in | 10 ++++++++++ bacula/configure | 19 ++++++++++++++++++- bacula/src/dird/bacula-dir.conf.in | 2 +- bacula/src/dird/dird_conf.c | 1 + bacula/technotes-2.3 | 3 +++ 5 files changed, 33 insertions(+), 2 deletions(-) diff --git a/bacula/autoconf/configure.in b/bacula/autoconf/configure.in index ab963790ad..9a35711054 100644 --- a/bacula/autoconf/configure.in +++ b/bacula/autoconf/configure.in @@ -1244,6 +1244,16 @@ AC_ARG_WITH(db_user, ) AC_SUBST(db_user) +db_password= +AC_ARG_WITH(db_password, + [ --with-db-password=UNAME specify database password (default *none*)] + [ + if test "x$withval" != "x" ; then + db_password=$withval + fi + ] +) +AC_SUBST(db_password) # # Handle users and groups for each daemon diff --git a/bacula/configure b/bacula/configure index d47ff3fa72..2e0b76b675 100755 --- a/bacula/configure +++ b/bacula/configure @@ -823,6 +823,7 @@ mon_fd_password mon_sd_password db_name db_user +db_password dir_user dir_group sd_user @@ -1509,6 +1510,13 @@ Optional Packages: --with-mon-sd-password=PASSWORD specify Storage daemon's password used by the monitor --with-db-name=DBNAME specify database name (default bacula) --with-db-user=UNAME specify database user (default bacula) + --with-db-password=UNAME specify database password (default *none*) + + if test "x$withval" != "x" ; then + db_password=$withval + fi + + --with-dir-user=USER specify user for Director daemon --with-dir-group=GROUP specify group for Director daemon --with-sd-user=USER specify user for Storage daemon @@ -17054,6 +17062,14 @@ fi +db_password= + +# Check whether --with-db_password was given. +if test "${with_db_password+set}" = set; then + withval=$with_db_password; +fi + + # # Handle users and groups for each daemon @@ -31152,6 +31168,7 @@ mon_fd_password!$mon_fd_password$ac_delim mon_sd_password!$mon_sd_password$ac_delim db_name!$db_name$ac_delim db_user!$db_user$ac_delim +db_password!$db_password$ac_delim dir_user!$dir_user$ac_delim dir_group!$dir_group$ac_delim sd_user!$sd_user$ac_delim @@ -31190,7 +31207,7 @@ DISTVER!$DISTVER$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 55; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 56; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 diff --git a/bacula/src/dird/bacula-dir.conf.in b/bacula/src/dird/bacula-dir.conf.in index f2e72d6652..2f77e4b575 100644 --- a/bacula/src/dird/bacula-dir.conf.in +++ b/bacula/src/dird/bacula-dir.conf.in @@ -231,7 +231,7 @@ Storage { # Generic catalog service Catalog { Name = MyCatalog - dbname = @db_name@; user = @db_user@; password = "" + dbname = "@db_name@"; dbuser = "@db_user@"; dbpassword = "@db_password@" } # Reasonable message delivery -- send most everything to email address diff --git a/bacula/src/dird/dird_conf.c b/bacula/src/dird/dird_conf.c index 25ee74e180..a55148df0a 100644 --- a/bacula/src/dird/dird_conf.c +++ b/bacula/src/dird/dird_conf.c @@ -238,6 +238,7 @@ static RES_ITEM cat_items[] = { /* keep this password as store_str for the moment */ {"password", store_str, ITEM(res_cat.db_password), 0, 0, 0}, {"dbpassword", store_str, ITEM(res_cat.db_password), 0, 0, 0}, + {"dbuser", store_str, ITEM(res_cat.db_user), 0, 0, 0}, {"user", store_str, ITEM(res_cat.db_user), 0, 0, 0}, {"dbname", store_str, ITEM(res_cat.db_name), 0, ITEM_REQUIRED, 0}, {"dbsocket", store_str, ITEM(res_cat.db_socket), 0, 0, 0}, diff --git a/bacula/technotes-2.3 b/bacula/technotes-2.3 index 9dbc06f02d..a0935c96bb 100644 --- a/bacula/technotes-2.3 +++ b/bacula/technotes-2.3 @@ -2,6 +2,9 @@ General: 19Jun08 +kes Add dbuser to DIR conf file (replaces user). +kes Add --with-db-password to ./configure +kes Fix regress to handle db_password. kes Fix a couple of pedantic compiler warnings. ebl Fix bug when starting a restore on a storage that doesn't have the requested MediaType. -- 2.39.2