]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix #1684 Use --with-db-password option in grant_bacula_privileges scripts
authorEric Bollengier <eric@eb.homelinux.org>
Tue, 25 Jan 2011 08:34:23 +0000 (09:34 +0100)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:39:53 +0000 (14:39 +0200)
bacula/src/cats/grant_mysql_privileges.in
bacula/src/cats/grant_postgresql_privileges.in

index 6ff59691933272caa813c85532542f11a6dda948..09a1569fa12a01069f16ccc4f6dee8fdffd5975c 100644 (file)
@@ -5,11 +5,15 @@
 db_user=${db_user:-@db_user@}
 bindir=@SQL_BINDIR@
 db_name=${db_name:-@db_name@}
+db_password=@db_password@
+if [ "$db_password" != "" ]; then
+   pass="identified by '$db_password'"
+fi
 
 if $bindir/mysql $* -u root -f <<END-OF-DATA
 use mysql
-grant all privileges on ${db_name}.* to ${db_user}@localhost;
-grant all privileges on ${db_name}.* to ${db_user}@"%";
+grant all privileges on ${db_name}.* to ${db_user}@localhost ${pass};
+grant all privileges on ${db_name}.* to ${db_user}@"%" ${pass};
 select * from user;
 flush privileges;
 END-OF-DATA
index fa90165a9d0e9d2912549385c39010a017143a06..d037ceee9501169b62627e206ac8ff640c6cb552 100644 (file)
@@ -5,10 +5,15 @@
 db_user=${db_user:-@db_user@}
 bindir=@SQL_BINDIR@
 db_name=${db_name:-@db_name@}
+db_password=@db_password@
+if [ "$db_password" != "" ]; then
+   pass="password '$db_password'"
+fi
+
 
 $bindir/psql -f - -d ${db_name} $* <<END-OF-DATA
 
-create user ${db_user};
+create user ${db_user} ${pass};
 
 -- for tables
 grant all on unsavedfiles to ${db_user};