pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Sergey Holod <sss@radiocom.net.ua>
To: pgsql-sql@postgresql.org
Subject: Making "SECURITY DEFINER" procedures..
Date: Tue, 29 Apr 2003 23:58:35 +0300
Message-ID: <200304292358.35245.sss@radiocom.net.ua> (raw)

Hello!!!

Just trying to make subj

I made user "data", schema "data", several tables and small procedures on them 
in that schema and then a greater function (as "SECURITY DEFINER") in 
"public" schema which uses previous functions.
I graned "EXECUTE" access to that function to "PUBLIC".

When I try execute that function I get "ERROR:  data: permission denied", but
when I add some notices between parts of function I see following:

tst=> select new_session('sergey','mypassword');
   NOTICE:  current user is data
   NOTICE:  after delete
   NOTICE:  after select
   NOTICE:  after insert
   NOTICE:  before return
   ERROR:  data: permission denied

so function executed with "data" privilegies, It deletes some data,
inserts another and so on, It even runs till "return", but then I get error...

It seems last error takes place during "auto commit" of transaction in which
function executes..

Just don't undestand what is happens..:(

-- 
With Best Regards,
Sergey Holod




view thread (6+ messages)  latest in thread

Message-ID: <200304292358.35245.sss@radiocom.net.ua>
Permalink:  ../200304292358.35245.sss@radiocom.net.ua/
Also on:    postgresql.org/message-id/200304292358.35245.sss@radiocom.net.ua

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: sss@radiocom.net.ua
  Subject: Re: Making "SECURITY DEFINER" procedures..
  In-Reply-To: <200304292358.35245.sss@radiocom.net.ua>

* 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