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


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to