aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Douma <rullzer@users.noreply.github.com>2016-07-18 13:04:10 +0200
committerGitHub <noreply@github.com>2016-07-18 13:04:10 +0200
commit3e00edff990a9255f6e71b08f1e5ff43b4e3a95c (patch)
tree479754ad8915dd568461abde5bb34acdda659139
parent89a32a2f84d73fedf12da3d90404b1894f64d0a9 (diff)
parent9781312648983c65135acac6eb014d74a454ed36 (diff)
downloadnextcloud-server-3e00edff990a9255f6e71b08f1e5ff43b4e3a95c.tar.gz
nextcloud-server-3e00edff990a9255f6e71b08f1e5ff43b4e3a95c.zip
Merge pull request #431 from nextcloud/postgres-password-not-quoted
Prevent syntax error when creating user or changing password
-rw-r--r--lib/private/Setup/PostgreSQL.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/private/Setup/PostgreSQL.php b/lib/private/Setup/PostgreSQL.php
index 30ca88f53aa..b4b0ebeb299 100644
--- a/lib/private/Setup/PostgreSQL.php
+++ b/lib/private/Setup/PostgreSQL.php
@@ -140,12 +140,12 @@ class PostgreSQL extends AbstractDatabase {
private function createDBUser(IDBConnection $connection) {
try {
- if ($this->userExists($connection, $this->dbUser)) {
+ if ($this->userExists($connection)) {
// change the password
- $query = $connection->prepare("ALTER ROLE " . addslashes($this->dbUser) . " CREATEDB WITH PASSWORD " . addslashes($this->dbPassword));
+ $query = $connection->prepare("ALTER ROLE " . addslashes($this->dbUser) . " CREATEDB WITH PASSWORD '" . addslashes($this->dbPassword) . "'");
} else {
// create the user
- $query = $connection->prepare("CREATE USER " . addslashes($this->dbUser) . " CREATEDB PASSWORD " . addslashes($this->dbPassword));
+ $query = $connection->prepare("CREATE USER " . addslashes($this->dbUser) . " CREATEDB PASSWORD '" . addslashes($this->dbPassword) . "'");
}
$query->execute();
} catch (DatabaseException $e) {