Skip to content

Commit 04e3fd7

Browse files
committed
Create a RULE wrapper around pg_user for the password entry
1 parent 3ad3fcc commit 04e3fd7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/bin/initdb/initdb.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#
2727
#
2828
# IDENTIFICATION
29-
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.35 1998/02/23 19:26:32 scrappy Exp $
29+
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.36 1998/02/23 20:32:40 scrappy Exp $
3030
#
3131
#-------------------------------------------------------------------------
3232

@@ -358,7 +358,11 @@ echo "COPY pg_user TO '$PGDATA/pg_pwd' USING DELIMITERS '\\t'" |\
358358
echo "GRANT SELECT ON pg_class TO PUBLIC" |\
359359
postgres -F -Q -D$PGDATA template1 2>&1 > /dev/null |\
360360

361-
echo "create view db_user as select usename,usesysid from pg_user;" |\
361+
echo "CREATE RULE pg_user_hide_pw as on SELECT to pg_user.passwd DO INSTEAD SELECT '********' as passwd;" | \
362+
postgres -F -Q -D$PGDATA template1 2>&1 > /dev/null |\
363+
grep -v "'DEBUG:"
364+
365+
echo "create view db_user as select * from pg_user;" |\
362366
postgres -F -Q -D$PGDATA template1 2>&1 > /dev/null |\
363367
grep -v "'DEBUG:"
364368
echo "grant select on db_user to public" |\

0 commit comments

Comments
 (0)