From: Marco van Wieringen Date: Sat, 3 Apr 2010 20:18:55 +0000 (+0200) Subject: Creating a database as an other user and giving grants doesn't seem to work for Ingre... X-Git-Tag: Release-7.0.0~2002 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=cce930b926b42fa56ef5680462ecc082db317564;p=bacula%2Fbacula Creating a database as an other user and giving grants doesn't seem to work for Ingres. Strange so for now create everything using the -u${db_user} option. This is something that needs to be investigated as it should be possible to have an different owner of the database. --- diff --git a/bacula/src/cats/create_ingres_database.in b/bacula/src/cats/create_ingres_database.in index 1e4973de70..9422010492 100755 --- a/bacula/src/cats/create_ingres_database.in +++ b/bacula/src/cats/create_ingres_database.in @@ -5,7 +5,8 @@ bindir=@SQL_BINDIR@ PATH="$bindir:$PATH" -db_name=@db_name@ +db_name=${db_name:-@db_name@} +db_user=${db_user:-@db_user@} # use SQL_ASCII to be able to put any filename into # the database even those created with unusual character sets @@ -21,7 +22,7 @@ ENCODING="ENCODING 'SQL_ASCII'" # #ENCODING="ENCODING 'UTF8'" -if createdb $* ${db_name} +if createdb -u${db_user} $* ${db_name} then echo "Creation of ${db_name} database succeeded." else diff --git a/bacula/src/cats/drop_ingres_database.in b/bacula/src/cats/drop_ingres_database.in index 23c75fe287..0a4c4f7a9a 100755 --- a/bacula/src/cats/drop_ingres_database.in +++ b/bacula/src/cats/drop_ingres_database.in @@ -4,9 +4,11 @@ # bindir=@SQL_BINDIR@ -db_name=@db_name@ +PATH="$bindir:$PATH" +db_name=${db_name:-@db_name@} +db_user=${db_user:-@db_user@} -if destroydb ${db_name} +if destroydb -u${db_user} ${db_name} then echo "Drop of ${db_name} database succeeded." else diff --git a/bacula/src/cats/drop_ingres_tables.in b/bacula/src/cats/drop_ingres_tables.in index 10b9f3c4bd..08996aa3e7 100755 --- a/bacula/src/cats/drop_ingres_tables.in +++ b/bacula/src/cats/drop_ingres_tables.in @@ -3,8 +3,9 @@ # shell script to delete Bacula tables for PostgreSQL bindir=@SQL_BINDIR@ -db_name=@db_name@ -db_user=@db_user@ +PATH="$bindir:$PATH" +db_name=${db_name:-@db_name@} +db_user=${db_user:-@db_user@} sql -u${db_user} ${db_name} $* <