]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix #1653 about make_catalog_backup default user name
authorEric Bollengier <eric@baculasystems.com>
Mon, 29 Feb 2016 16:53:01 +0000 (17:53 +0100)
committerKern Sibbald <kern@sibbald.com>
Tue, 31 May 2016 06:21:41 +0000 (08:21 +0200)
bacula/src/cats/make_catalog_backup.in

index 637fcf7a6d6857e0327712dab86e46b0f277c63e..b77b1088679cb7fa77ebaef4f79d81b4345eef1f 100755 (executable)
@@ -23,6 +23,7 @@
 #
 
 default_db_type=@DEFAULT_DB_TYPE@
+user=${2:-@db_user@}
 
 #
 # See if the fifth argument is a valid backend name.
@@ -74,7 +75,7 @@ case ${db_type} in
     else
       MYSQLHOST=""
     fi
-    ${BINDIR}/mysqldump -u ${2}${MYSQLPASSWORD}${MYSQLHOST} -f --opt $1 >$1.sql
+    ${BINDIR}/mysqldump -u ${user}${MYSQLPASSWORD}${MYSQLHOST} -f --opt $1 >$1.sql
     ;;
   postgresql)
     BINDIR=@POSTGRESQL_BINDIR@
@@ -88,7 +89,7 @@ case ${db_type} in
       PGHOST=""
     fi
     # you could also add --compress for compression.  See man pg_dump
-    exec ${BINDIR}/pg_dump -c $PGHOST -U $2 $1 >$1.sql
+    exec ${BINDIR}/pg_dump -c $PGHOST -U $user $1 >$1.sql
     ;;
 esac
 #