Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 #380: Debian: when migrating from 13.2 to 14.2 with postgres backend, database permissions are not set correctly
- Loading branch information
1 parent
c6ba3e9
commit 423c64e
Showing
6 changed files
with
30 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
@backenddir@/libbareoscats-mysql*.so | ||
@scriptdir@/ddl/*/mysql*.sql | ||
/usr/share/dbconfig-common/data/bareos-database-common/install/mysql | ||
/usr/share/dbconfig-common/data/bareos-database-common/upgrade-dbadmin/mysql/* | ||
/usr/share/dbconfig-common/data/bareos-database-common/upgrade/mysql/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
@backenddir@/libbareoscats-sqlite3*.so | ||
@scriptdir@/ddl/*/sqlite3*.sql | ||
/usr/share/dbconfig-common/data/bareos-database-common/install/sqlite3 | ||
/usr/share/dbconfig-common/data/bareos-database-common/upgrade-dbadmin/sqlite3/* | ||
/usr/share/dbconfig-common/data/bareos-database-common/upgrade/sqlite3/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters