Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2002-09-24 23:14:25 +0000
committerTom Lane2002-09-24 23:14:25 +0000
commitc6367df506b6f39b63b5ff85304b5618e0f61fb2 (patch)
tree29edd9310d6151b49dc4a7447b634cee380ddbe9 /src/bin/scripts/createlang.sh
parente92bec2844f2da02d217d18cb7260cf04f05c43e (diff)
Change default privileges for languages and functions to be PUBLIC USAGE
and PUBLIC EXECUTE, respectively. Per discussion about easing updates from prior versions.
Diffstat (limited to 'src/bin/scripts/createlang.sh')
-rw-r--r--src/bin/scripts/createlang.sh12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/bin/scripts/createlang.sh b/src/bin/scripts/createlang.sh
index 3f0009224d2..b84680aab79 100644
--- a/src/bin/scripts/createlang.sh
+++ b/src/bin/scripts/createlang.sh
@@ -7,7 +7,7 @@
# Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California
#
-# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createlang.sh,v 1.38 2002/08/22 00:01:47 tgl Exp $
+# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createlang.sh,v 1.39 2002/09/24 23:14:25 tgl Exp $
#
#-------------------------------------------------------------------------
@@ -291,8 +291,13 @@ if [ "$?" -ne 0 ]; then
exit 1
fi
-if test -n "$trusted"; then
- sqlcmd="GRANT USAGE ON LANGUAGE \"$langname\" TO PUBLIC;"
+# ----------
+# Grant privileges. As of 7.3 the default privileges for a language include
+# public USAGE, so we need not change them for a trusted language; but it
+# seems best to disable public USAGE for an untrusted one.
+# ----------
+if test -z "$trusted"; then
+ sqlcmd="REVOKE ALL ON LANGUAGE \"$langname\" FROM PUBLIC;"
if [ "$showsql" = yes ]; then
echo "$sqlcmd"
fi
@@ -302,4 +307,5 @@ if test -n "$trusted"; then
exit 1
fi
fi
+
exit 0