From 4327ed83820f045395bbf1431cdddbdedfa19555 Mon Sep 17 00:00:00 2001
From: Brice Maron <brice@bmaron.net>
Date: Mon, 3 Dec 2012 20:20:17 +0000
Subject: [PATCH] Revoke DB rights on install only if the db is newly created

---
 lib/setup.php | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/setup.php b/lib/setup.php
index 264cd55795..fdd10be682 100644
--- a/lib/setup.php
+++ b/lib/setup.php
@@ -319,9 +319,11 @@ class OC_Setup {
 				$entry.='Offending command was: '.$query.'<br />';
 				echo($entry);
 			}
+			else {
+				$query = "REVOKE ALL PRIVILEGES ON DATABASE \"$e_name\" FROM PUBLIC";
+				$result = pg_query($connection, $query);
+			}
 		}
-		$query = "REVOKE ALL PRIVILEGES ON DATABASE \"$e_name\" FROM PUBLIC";
-		$result = pg_query($connection, $query);
 	}
 
 	private static function pg_createDBUser($name, $password, $connection) {
-- 
GitLab