summaryrefslogtreecommitdiffstats
path: root/lib/private/Setup
diff options
context:
space:
mode:
authorVitor Mattos <vitor@php.rio>2019-04-21 14:50:31 -0300
committerVitor Mattos <vitor@php.rio>2019-04-21 15:00:39 -0300
commit824cc0af1ef91394c98d405d672f63e425d375d5 (patch)
tree389764f0af80a0dc8326f4e9aac244c12c3d92d5 /lib/private/Setup
parent49829482c898212c1bb4e7461cad7983541cd528 (diff)
downloadnextcloud-server-824cc0af1ef91394c98d405d672f63e425d375d5.tar.gz
nextcloud-server-824cc0af1ef91394c98d405d672f63e425d375d5.zip
Bugfix: user is not allowed
The created user don't has permission to connect to database. I changed the code to give permission Signed-off-by: Vitor Mattos <vitor@php.rio>
Diffstat (limited to 'lib/private/Setup')
-rw-r--r--lib/private/Setup/PostgreSQL.php2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/private/Setup/PostgreSQL.php b/lib/private/Setup/PostgreSQL.php
index 283ab5f925c..23c5ec73929 100644
--- a/lib/private/Setup/PostgreSQL.php
+++ b/lib/private/Setup/PostgreSQL.php
@@ -154,6 +154,8 @@ class PostgreSQL extends AbstractDatabase {
// create the user
$query = $connection->prepare("CREATE USER " . addslashes($this->dbUser) . " CREATEDB PASSWORD '" . addslashes($this->dbPassword) . "'");
$query->execute();
+ $query = $connection->prepare('GRANT CONNECT ON DATABASE ' . $this->dbName . ' TO '.addslashes($this->dbUser));
+ $query->execute();
} catch (DatabaseException $e) {
$this->logger->error('Error while trying to create database user');
$this->logger->logException($e);