File: bug-137986-pgsql-dropuser.patch

package info (click to toggle)
wwwconfig-common 0.3.0
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 488 kB
  • sloc: sh: 952; makefile: 5
file content (23 lines) | stat: -rw-r--r-- 1,290 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
--- /usr/share/wwwconfig-common/pgsql-dropuser.sh	Tue Feb  5 13:11:15 2002
+++ pgsql-dropuser.sh	Tue Mar 12 12:37:22 2002
@@ -30,16 +30,16 @@
     error="No database administrator specified."
 elif [ ! -x $(which psql) ] ; then
     error="No pgsql client to execute."
-elif ! $pgsqlcmd -d $systemdb -c "SELECT usename FROM pg_shadow;" >/dev/null 2>&1 ; then
+elif ! $pgsqlcmd -q -d $systemdb -c "SELECT usename FROM pg_shadow;" >/dev/null 2>&1 ; then
     error="Error when trying to connect to the pgsql database.
     This error can occur if you have no database to connect to, or
     if the password was incorrect.
 	use: dpkg-reconfigure -plow packagename to reconfigure."
 else
-    if [ $($pgsqlcmd -d $systemdb -q -t -A -c "SELECT usename FROM pg_shadow WHERE usename='$dbuser';") = "$dbuser" ] ; then
-	if $pgsqlcmd -d $systemdb -c "
+    if [ "$($pgsqlcmd -d $systemdb -q -t -A -c "SELECT usename FROM pg_shadow WHERE usename='$dbuser';")" = "$dbuser" ] ; then
+	if $pgsqlcmd -q -d $systemdb -c "
 	DELETE FROM pg_shadow
-	WHERE usename='$dbuser';" > /dev/null 2>&1 ; then
+	WHERE usename='$dbuser';" ; then
 	    if [ -z "$($pgsqlcmd -d $systemdb -q -t -A -c "SELECT usename FROM pg_shadow WHERE usename='$dbuser';")" ] ; then
 		log="${log}User $dbuser droped."
 		status=drop