[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libeufin] branch master updated: fixing schema permissions: needs USAGE
From: |
gnunet |
Subject: |
[libeufin] branch master updated: fixing schema permissions: needs USAGE privilege |
Date: |
Sun, 03 Dec 2023 16:45:07 +0100 |
This is an automated email from the git hooks/post-receive script.
ms pushed a commit to branch master
in repository libeufin.
The following commit(s) were added to refs/heads/master by this push:
new d148d5da fixing schema permissions: needs USAGE privilege
d148d5da is described below
commit d148d5da3fdf88b7f1fbca02a71422d9942b58d0
Author: MS <ms@taler.net>
AuthorDate: Sun Dec 3 16:43:48 2023 +0100
fixing schema permissions: needs USAGE privilege
---
contrib/libeufin-nexus-dbconfig | 5 +++++
util/src/main/kotlin/DB.kt | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/contrib/libeufin-nexus-dbconfig b/contrib/libeufin-nexus-dbconfig
index c8151564..ad96a2e5 100755
--- a/contrib/libeufin-nexus-dbconfig
+++ b/contrib/libeufin-nexus-dbconfig
@@ -104,6 +104,11 @@ then
echo "Failed to grant access to database '$DBNAME' to '$DBUSER'."
1>&2
exit 1
fi
+ if ! echo "GRANT USAGE ON SCHEMA _v TO \"$DBUSER\"" \
+ | sudo -i -u postgres psql "$DBNAME"
+ then
+ echo "Failed to grant usage privilege on schema '_v' to '$DBUSER'.
Maybe OK if it does not exist. Will continue." 1>&2
+ fi
if ! echo "GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA _v TO
\"$DBUSER\"" \
| sudo -i -u postgres psql "$DBNAME"
then
diff --git a/util/src/main/kotlin/DB.kt b/util/src/main/kotlin/DB.kt
index bfa77236..ec7268f7 100644
--- a/util/src/main/kotlin/DB.kt
+++ b/util/src/main/kotlin/DB.kt
@@ -196,7 +196,7 @@ fun PreparedStatement.executeProcedureViolation(): Boolean {
fun maybeApplyV(conn: PgConnection, cfg: DatabaseConfig) {
conn.transaction {
val checkVSchema = conn.prepareStatement(
- "SELECT EXISTS (SELECT FROM pg_tables WHERE schemaname = '_v' AND
tablename = 'patches')"
+ "SELECT schema_name FROM information_schema.schemata WHERE
schema_name = '_v'"
)
if (!checkVSchema.executeQueryCheck()) {
logger.debug("_v schema not found, applying versioning.sql")
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [libeufin] branch master updated: fixing schema permissions: needs USAGE privilege,
gnunet <=