bareos: master 423c64e8

Author Committer Branch Timestamp Parent
joergs joergs master 2014-12-20 13:44 master c6ba3e9f Pending
Affected Issues  0000380: Debian: when migrating from 13.2 to 14.2 with postgres backend on Debian systems, database permissions are not set correctly
Changeset Debian: fixes a problem when migrating to dbconfig

The Bareos database maintenance scripts for the postgres backend
create the Bareos database using the database administrator account
and grant permission to the Bareos database user.
When a Bareos update requires a database schema update,
the user has to call
update_bareos_tables
and
grant_bareos_privileges.

When using dbconfig (Bareos >= 14.1),
only update_bareos_tables is performed,
as grant_bareos_privileges would require variable substitutions (db_name, db_user and db_password),
which is not supported in dbconfig (dbc_sql_substitutions only works on installing, not on updates).
Therefore it is necessary, that new tables are created as the Bareos database user,
so it automatically has sufficient permissions.
As the Bareos database user can not drop tables not created by himself,
the drop statement must be executed as database administrator user.

This patch implements this.

The resuls to:

Updating from Bareos < 14.1:
database: owner postgres
tables already existing before 14.1: owner postgres, permission to baroes
tables created after 14.1: owner bareos

Installing Bareos >= 14.1:
database: owner bareos
tables: owner bareos

Fixes 0000380: Debian: when migrating from 13.2 to 14.2 with postgres backend, database permissions are not set correctly
mod - debian/bareos-database-common.config.in Diff File
mod - debian/bareos-database-common.postinst.in Diff File
mod - debian/bareos-database-mysql.install.in Diff File
mod - debian/bareos-database-postgresql.install.in Diff File
mod - debian/bareos-database-sqlite3.install.in Diff File
mod - platforms/debian/Makefile.in Diff File