Commit f39748a7 authored by Peter Eisentraut's avatar Peter Eisentraut

Forbid REVOKE on untrusted languages, and don't dump privileges of

untrusted languages (in case they sneak in).
parent 9a1cab43
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/catalog/aclchk.c,v 1.95 2003/11/29 19:51:42 pgsql Exp $ * $PostgreSQL: pgsql/src/backend/catalog/aclchk.c,v 1.96 2003/12/19 14:21:56 petere Exp $
* *
* NOTES * NOTES
* See acl.h. * See acl.h.
...@@ -594,7 +594,7 @@ ExecuteGrantStmt_Language(GrantStmt *stmt) ...@@ -594,7 +594,7 @@ ExecuteGrantStmt_Language(GrantStmt *stmt)
aclcheck_error(ACLCHECK_NO_PRIV, ACL_KIND_LANGUAGE, aclcheck_error(ACLCHECK_NO_PRIV, ACL_KIND_LANGUAGE,
NameStr(pg_language_tuple->lanname)); NameStr(pg_language_tuple->lanname));
if (!pg_language_tuple->lanpltrusted && stmt->is_grant) if (!pg_language_tuple->lanpltrusted)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_WRONG_OBJECT_TYPE), (errcode(ERRCODE_WRONG_OBJECT_TYPE),
errmsg("language \"%s\" is not trusted", langname))); errmsg("language \"%s\" is not trusted", langname)));
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* by PostgreSQL * by PostgreSQL
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.360 2003/12/06 03:00:12 tgl Exp $ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.361 2003/12/19 14:21:56 petere Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -4633,6 +4633,7 @@ dumpProcLang(Archive *fout, ProcLangInfo *plang) ...@@ -4633,6 +4633,7 @@ dumpProcLang(Archive *fout, ProcLangInfo *plang)
NULL, "", NULL, "",
plang->dobj.catId, 0, plang->dobj.dumpId); plang->dobj.catId, 0, plang->dobj.dumpId);
if (plang->lanpltrusted)
dumpACL(fout, plang->dobj.catId, plang->dobj.dumpId, "LANGUAGE", dumpACL(fout, plang->dobj.catId, plang->dobj.dumpId, "LANGUAGE",
qlanname, plang->lanname, qlanname, plang->lanname,
funcInfo->pronamespace->nspname, funcInfo->pronamespace->nspname,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment