Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f39748a

Browse files
committed
Forbid REVOKE on untrusted languages, and don't dump privileges of
untrusted languages (in case they sneak in).
1 parent 9a1cab4 commit f39748a

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/backend/catalog/aclchk.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/catalog/aclchk.c,v 1.95 2003/11/29 19:51:42 pgsql Exp $
11+
* $PostgreSQL: pgsql/src/backend/catalog/aclchk.c,v 1.96 2003/12/19 14:21:56 petere Exp $
1212
*
1313
* NOTES
1414
* See acl.h.
@@ -594,7 +594,7 @@ ExecuteGrantStmt_Language(GrantStmt *stmt)
594594
aclcheck_error(ACLCHECK_NO_PRIV, ACL_KIND_LANGUAGE,
595595
NameStr(pg_language_tuple->lanname));
596596

597-
if (!pg_language_tuple->lanpltrusted && stmt->is_grant)
597+
if (!pg_language_tuple->lanpltrusted)
598598
ereport(ERROR,
599599
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
600600
errmsg("language \"%s\" is not trusted", langname)));

src/bin/pg_dump/pg_dump.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* by PostgreSQL
1313
*
1414
* IDENTIFICATION
15-
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.360 2003/12/06 03:00:12 tgl Exp $
15+
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.361 2003/12/19 14:21:56 petere Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -4633,10 +4633,11 @@ dumpProcLang(Archive *fout, ProcLangInfo *plang)
46334633
NULL, "",
46344634
plang->dobj.catId, 0, plang->dobj.dumpId);
46354635

4636-
dumpACL(fout, plang->dobj.catId, plang->dobj.dumpId, "LANGUAGE",
4637-
qlanname, plang->lanname,
4638-
funcInfo->pronamespace->nspname,
4639-
NULL, plang->lanacl);
4636+
if (plang->lanpltrusted)
4637+
dumpACL(fout, plang->dobj.catId, plang->dobj.dumpId, "LANGUAGE",
4638+
qlanname, plang->lanname,
4639+
funcInfo->pronamespace->nspname,
4640+
NULL, plang->lanacl);
46404641

46414642
free(qlanname);
46424643

0 commit comments

Comments
 (0)