has_language_privilege returns incorrect answer for non-superuser

From: Joe Conway <mail(at)joeconway(dot)com>
To: "Hackers (PostgreSQL)" <pgsql-hackers(at)postgresql(dot)org>
Subject: has_language_privilege returns incorrect answer for non-superuser
Date: 2012-07-10 01:23:56
Message-ID: 4FFB842C.6090804@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I noticed today that has_language_privilege() returns incorrect answer
for non-superuser, e.g.:

8<---------------------------------------------------
select has_language_privilege('nobody',
'plperlu',
'usage');
has_language_privilege
------------------------
t
(1 row)

test1=# \c - nobody
You are now connected to database "test1" as user "nobody".

create function f() returns text as $$ $$ language plperlu;
ERROR: permission denied for language plperlu
8<---------------------------------------------------

I verified this behavior on head as well as 9.1 (didn't bother looking
any further back). Looks like the reason is that CreateFunction()
correctly checks lanpltrusted, whereas pg_language_aclmask() does not.

Seems like a bug to me -- opinions?

Joe

--
Joe Conway
credativ LLC: http://www.credativ.us
Linux, PostgreSQL, and general Open Source
Training, Service, Consulting, & 24x7 Support

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2012-07-10 02:48:06 Use of rsync for data directory copying
Previous Message Alexander Korotkov 2012-07-09 23:33:03 Testing of various opclasses for ranges