Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 715722 Details for
Bug 923614
procedures are owned by postgres instead of engine user
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Sets ownership of DB objects to engine
0001-BZ923614-make-sure-objects-are-owned-by-engine-user.patch (text/plain), 2.36 KB, created by
Mark Huth
on 2013-03-24 23:54:31 UTC
(
hide
)
Description:
Sets ownership of DB objects to engine
Filename:
MIME Type:
Creator:
Mark Huth
Created:
2013-03-24 23:54:31 UTC
Size:
2.36 KB
patch
obsolete
>From 9f046860d803e9ea83486c735df6cdda372e3826 Mon Sep 17 00:00:00 2001 >From: Mark Huth <mhuth@redhat.com> >Date: Mon, 25 Mar 2013 09:44:16 +1000 >Subject: [PATCH] BZ923614 - make sure objects are owned by engine user > >--- > backend/manager/dbscripts/dbcustomfunctions.sh | 20 ++++++++++++++++++++ > backend/manager/dbscripts/restore.sh | 6 +++++- > 2 files changed, 25 insertions(+), 1 deletions(-) > >diff --git a/backend/manager/dbscripts/dbcustomfunctions.sh b/backend/manager/dbscripts/dbcustomfunctions.sh >index df06750..fbd700e 100755 >--- a/backend/manager/dbscripts/dbcustomfunctions.sh >+++ b/backend/manager/dbscripts/dbcustomfunctions.sh >@@ -16,6 +16,7 @@ set_defaults() { > VERBOSE=false > LOGFILE="$ME.log" > export PGPASSFILE="/etc/ovirt-engine/.pgpass" >+ DBOBJECT_OWNER="engine" > } > > #refreshes views >@@ -25,3 +26,22 @@ refresh_views() { > execute_file "create_dwh_views.sql" ${DATABASE} ${SERVERNAME} ${PORT} > /dev/null > } > >+verify_dbobject_ownership() { >+ cmd="select c.relname from pg_class c join pg_roles r on r.oid = c.relowner join pg_namespace n on n.oid = c.relnamespace where c.relkind in ('r','v','S') and n.nspname = 'public' and r.rolname != '${DBOBJECT_OWNER}';" >+ res=$(execute_command "${cmd}" engine ${SERVERNAME} ${PORT}) >+ if [ -n "${res}" ]; then >+ cmd="" >+ echo "Changing ownership of objects in database '$DATABASE' to owner '$DBOBJECT_OWNER' started..." >+ for tab in $(echo $res); do >+ cmd=${cmd}"alter table $tab owner to ${DBOBJECT_OWNER}; " >+ done >+ echo $cmd | psql -h $SERVERNAME -p $PORT -U $USERNAME -d $DATABASE --set ON_ERROR_STOP=1 >+ echo -n "Changing ownership of objects in database '$DATABASE' to owner '$DBOBJECT_OWNER' " >+ if [ $? -eq 0 ]; then >+ echo "completed." >+ else >+ echo "failed." >+ return 1 >+ fi >+ fi >+} >diff --git a/backend/manager/dbscripts/restore.sh b/backend/manager/dbscripts/restore.sh >index 07619cb..27c790d 100755 >--- a/backend/manager/dbscripts/restore.sh >+++ b/backend/manager/dbscripts/restore.sh >@@ -69,8 +69,12 @@ psql -h ${SERVERNAME} -p ${PORT} -U ${USERNAME} -f ${FILE} > > if [ $? -eq 0 ];then > echo "Restore of database $DATABASE from $FILE completed." >- exit 0 > else > usage > exit 1 > fi >+ >+verify_dbobject_ownership >+if [ $? -ne 0 ]; then >+ exit 1 >+fi >-- >1.7.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 923614
:
715686
| 715722