From: Alvaro Herrera <alvherre@commandprompt.com>
To: Dave Fennell <dave@microtux.co.uk>
Cc: pgsql-bugs <pgsql-bugs@postgresql.org>
Subject: Re: BUG #6076: Unexpected "Security Definer / invoker" interaction
Date: Fri, 24 Jun 2011 14:28:46 -0400
Message-ID: <1308939809-sup-2803@alvh.no-ip.org> (raw)
In-Reply-To: <201106241448.p5OEmekP044181@wwwmaster.postgresql.org>
References: <201106241448.p5OEmekP044181@wwwmaster.postgresql.org>
Excerpts from Dave Fennell's message of vie jun 24 10:48:40 -0400 2011:
> Not sure if this is a bug or possibly just undocumented (or unclearly
> documented) behaviour but the interaction of functions defined as "security
> definer" and functions defined as "security invoker" is not what I would
> expect.
>
> I would expect that if a function defined as "security definer" calls a
> function defined as "security invoker" the "invoker" role used would be the
> "definer" of the first function? However it appears that the *actual*
> invoker (current user) is used.
I think your problem is that you need an explicit SET ROLE to sub1
before calling sub1.func2(). Alternatively you could set up global so
that it "inherits" (which would automatically give it the privileges
that both sub1 and sub2 have).
There doesn't seem to be a bug here.
--
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: alvherre@commandprompt.com, dave@microtux.co.uk
Subject: Re: BUG #6076: Unexpected "Security Definer / invoker" interaction
In-Reply-To: <1308939809-sup-2803@alvh.no-ip.org>
References: <201106241448.p5OEmekP044181@wwwmaster.postgresql.org> <1308939809-sup-2803@alvh.no-ip.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox