libeufin

Integration and sandbox testing for FinTech APIs and data formats
Log | Files | Refs | Submodules | README | LICENSE

commit 082716f407eb9306d1cfa2cc3702e5b9ca9be2e3
parent 9ee3c46e856c21998b4643a58622daa06da84ee8
Author: Christian Grothoff <grothoff@gnunet.org>
Date:   Thu, 30 Nov 2023 15:41:21 +0900

-fix permissions on _v

Diffstat:
Mcontrib/libeufin-bank-dbconfig | 2+-
Mcontrib/libeufin-nexus-dbconfig | 2+-
Mutil/src/main/kotlin/DB.kt | 2++
3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/contrib/libeufin-bank-dbconfig b/contrib/libeufin-bank-dbconfig @@ -105,7 +105,7 @@ then echo "Failed to grant access to database '$DBNAME' to '$DBUSER'." 1>&2 exit 1 fi - if ! echo "GRANT ALL PRIVILEGES ON SCHEMA _v TO \"$DBUSER\"" \ + if ! echo "GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA _v TO \"$DBUSER\"" \ | sudo -i -u postgres psql "$DBNAME" then echo "Failed to grant access to schema '_v' to '$DBUSER'. Maybe OK if it does not exist. Will continue." 1>&2 diff --git a/contrib/libeufin-nexus-dbconfig b/contrib/libeufin-nexus-dbconfig @@ -104,7 +104,7 @@ then echo "Failed to grant access to database '$DBNAME' to '$DBUSER'." 1>&2 exit 1 fi - if ! echo "GRANT ALL PRIVILEGES ON SCHEMA _v TO \"$DBUSER\"" \ + if ! echo "GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA _v TO \"$DBUSER\"" \ | sudo -i -u postgres psql "$DBNAME" then echo "Failed to grant access to schema '_v' to '$DBUSER'. Maybe OK if it does not exist. Will continue." 1>&2 diff --git a/util/src/main/kotlin/DB.kt b/util/src/main/kotlin/DB.kt @@ -201,6 +201,8 @@ fun initializeDatabaseTables(cfg: DatabaseConfig, sqlFilePrefix: String) { try { conn.execSQLUpdate(sqlVersioning) } catch (e: SQLException) {} + } + conn.transaction { val checkStmt = conn.prepareStatement("SELECT count(*) as n FROM _v.patches where patch_name = ?") for (n in 1..9999) {