]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/cats/grant_postgresql_privileges.in
Correct compile error
[bacula/bacula] / bacula / src / cats / grant_postgresql_privileges.in
index 60df1692a83006cc1ecfc8587632c1cbd53949b7..ab582e859f1929a88dc0cc143027079b01c6cf82 100644 (file)
@@ -2,10 +2,11 @@
 #
 # shell script to grant privileges to the bacula database
 #
-USER=bacula
+USER=@db_user@
 bindir=@SQL_BINDIR@
+db_name=@db_name@
 
-if $bindir/psql -f - -d bacula $* <<END-OF-DATA
+if $bindir/psql -f - -d ${db_name} $* <<END-OF-DATA
 
 create user ${USER};
 
@@ -27,6 +28,10 @@ grant all on cdimages          to ${USER};
 grant all on mediatype   to ${USER};
 grant all on storage     to ${USER};
 grant all on device      to ${USER};
+grant all on status      to ${USER};
+grant all on location    to ${USER};
+grant all on locationlog  to ${USER};
+grant all on log         to ${USER};
 
 -- for sequences on those tables
 
@@ -43,11 +48,13 @@ grant select, update on basefiles_baseid_seq           to ${USER};
 grant select, update on storage_storageid_seq     to ${USER};
 grant select, update on mediatype_mediatypeid_seq  to ${USER};
 grant select, update on device_deviceid_seq       to ${USER};
-
+grant select, update on location_locationid_seq    to ${USER};
+grant select, update on locationlog_loclogid_seq   to ${USER};
+grant select, update on log_logid_seq             to ${USER};
 
 END-OF-DATA
 then
-   echo "Privileges for ${USER} granted."
+   echo "Privileges for ${USER} granted on ${db_name}."
    exit 0
 else
    echo "Error creating privileges."