OSDN Git Service

From: Andreas.Zeugswetter@telecom.at
authorMarc G. Fournier <scrappy@hub.org>
Thu, 19 Feb 1998 17:25:58 +0000 (17:25 +0000)
committerMarc G. Fournier <scrappy@hub.org>
Thu, 19 Feb 1998 17:25:58 +0000 (17:25 +0000)
Improved fix to pg_user/passwd problem...using rewrite rules

src/bin/initdb/initdb.sh

index 65e6458..9a85dc6 100644 (file)
@@ -26,7 +26,7 @@
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.32 1998/02/19 17:19:45 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.33 1998/02/19 17:25:58 scrappy Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -351,6 +351,18 @@ echo "vacuuming template1"
 echo "vacuum" | postgres -F -Q -D$PGDATA template1 2>&1 > /dev/null |\
        grep -v "^DEBUG:"
 
+echo "Altering pg_user acl"
+echo "REVOKE ALL ON pg_user FROM public" | \
+        postgres -F -Q -D$PGDATA template1 2>&1 > /dev/null |\
+         grep -v "'DEBUG:"
+echo "GRANT SELECT ON pg_user TO public" | \
+        postgres -F -Q -D$PGDATA template1 2>&1 > /dev/null |\
+         grep -v "'DEBUG:"
+echo "CREATE RULE pg_user_hide_pw as on SELECT to pg_user.passwd DO INSTEAD SELE
+CT '********' as passwd;" | \
+        postgres -F -Q -D$PGDATA template1 2>&1 > /dev/null |\
+         grep -v "'DEBUG:"
+
 echo "COPY pg_user TO '$PGDATA/pg_pwd' USING DELIMITERS '\\t'" | postgres -F -Q -D$PGDATA template1 2>&1 > /dev/null |\
          grep -v "'DEBUG:"