pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: bashtanov@imap.cc
To: pgsql-bugs@postgresql.org
Subject: BUG #11552: Trigger functions (but not funcs in trigger or rule conditions) are called regardless their privs
Date: Thu, 02 Oct 2014 08:42:08 +0000
Message-ID: <20141002084208.2543.34215@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

The following bug has been logged on the website:

Bug reference:      11552
Logged by:          Alexey Bashtanov
Email address:      bashtanov@imap.cc
PostgreSQL version: 9.3.4
Operating system:   CentOS 6.5
Description:        

Hello!

Actions I performed:
0. login as user repl (I have one)
1. create a table "x", reassign it to ro user
2. create a function foo() owned by repl
3. create a trigger after insert on x for each row execute foo()
4. make the function foo() not callable by anyone (revoke execute from
public and from repl)
5. login as ro
6. try to insert into x. It works, trigger is fired (!)
7. login as repl
8. make the function foo() callable by repl
9. drop the existing trigger, create another one similar but with condition
`when (foo() is null)`
10. make the function foo() not callable by anyone 
11. login as ro
12. try to insert into x. It does not work, trigger is not fired because it
cannot call foo()

The behavior in pp. 6, 12 is pretty strange, namely that it is different in
these two situations.
At least this should be mentioned in docs.

Regards, Alexey



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



Message-ID: <20141002084208.2543.34215@wrigleys.postgresql.org>
Permalink:  ../20141002084208.2543.34215@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20141002084208.2543.34215@wrigleys.postgresql.org

 · 

reply

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: bashtanov@imap.cc
  Subject: Re: BUG #11552: Trigger functions (but not funcs in trigger or rule conditions) are called regardless their privs
  In-Reply-To: <20141002084208.2543.34215@wrigleys.postgresql.org>
  References: <20141002084208.2543.34215@wrigleys.postgresql.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