pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Donald Fraser <demolish@cwgsy.net>
Cc: [BUGS] <pgsql-bugs@postgresql.org>
Subject: Re: Bugs with rules on views/tables: permission denied
Date: Mon, 24 Feb 2003 15:29:17 -0500
Message-ID: <5303.1046118557@sss.pgh.pa.us> (raw)
In-Reply-To: <00cb01c2dc21$12eae290$1664a8c0@DEMOLITION>
References: <A102805E-3D28-11D7-A5D5-000393BE2C60@queens.unimelb.edu.au>
	<006001c2dbfc$0cddcfe0$1664a8c0@DEMOLITION>
	<3150.1046097764@sss.pgh.pa.us>
	<00cb01c2dc21$12eae290$1664a8c0@DEMOLITION>

"Donald Fraser" <demolish@cwgsy.net> writes:
> As USER chkrule do:
> Bugs=3D> INSERT INTO vu_tbl_test (id, s_text) VALUES('1','sometext');
> ERROR:  vu_tbl_test: permission denied

What I get is 
	ERROR:  test_func: permission denied
and the needed fix is to grant execute privilege on the function to the
calling user.

> If you give the USER chkrule UPDATE permissions on the view vu_tbl_test the=
> n the error at Scenario 1 goes away.

Not for me.

The reason it acts this way is that rule permissions apply to tables
mentioned in the rule, not to functions.  This is at least partly for
historical reasons: functions didn't have permissions to check, back
when the rule system was designed.  But I'm not sure that it's wrong.
In your example, the end user is controlling the arguments given to
test_func.  If the rule allowed him to call test_func without having
permission to do so, there'd be the potential for security breaches.

			regards, tom lane



view thread (5+ messages)  latest in thread

Message-ID: <5303.1046118557@sss.pgh.pa.us>
Permalink:  ../5303.1046118557@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/5303.1046118557@sss.pgh.pa.us

 · 

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-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, demolish@cwgsy.net, pgsql-bugs@postgresql.org
  Subject: Re: Bugs with rules on views/tables: permission denied
  In-Reply-To: <5303.1046118557@sss.pgh.pa.us>
  References: <A102805E-3D28-11D7-A5D5-000393BE2C60@queens.unimelb.edu.au> <006001c2dbfc$0cddcfe0$1664a8c0@DEMOLITION> <3150.1046097764@sss.pgh.pa.us> <00cb01c2dc21$12eae290$1664a8c0@DEMOLITION> <5303.1046118557@sss.pgh.pa.us>

* 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