pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter_e@gmx.net>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Prohibit transaction commands in security definer procedures
Date: Fri, 13 Jul 2018 08:45:30 +0000
Message-ID: <E1fdthi-0001vI-8c@gemulon.postgresql.org> (raw)

Prohibit transaction commands in security definer procedures

Starting and aborting transactions in security definer procedures
doesn't work.  StartTransaction() insists that the security context
stack is empty, so this would currently cause a crash, and
AbortTransaction() resets it.  This could be made to work by
reorganizing the code, but right now we just prohibit it.

Reported-by: amul sul <sulamul@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/CAAJ_b96Gupt_LFL7uNyy3c50-wbhA68NUjiK5%3DrF6_w%3Dpq_T%3DQ...

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/3884072329bd1ad7d41bf7582c5d60e969365634

Modified Files
--------------
doc/src/sgml/ref/create_procedure.sgml              |  6 ++++++
src/backend/commands/functioncmds.c                 |  9 +++++++++
src/pl/plpgsql/src/expected/plpgsql_transaction.out | 12 ++++++++++++
src/pl/plpgsql/src/sql/plpgsql_transaction.sql      | 13 +++++++++++++
4 files changed, 40 insertions(+)



view thread (2+ messages)

Message-ID: <E1fdthi-0001vI-8c@gemulon.postgresql.org>
Permalink:  ../E1fdthi-0001vI-8c@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1fdthi-0001vI-8c@gemulon.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-committers@postgresql.org
  Cc: peter_e@gmx.net
  Subject: Re: pgsql: Prohibit transaction commands in security definer procedures
  In-Reply-To: <E1fdthi-0001vI-8c@gemulon.postgresql.org>
  References: <E1fdthi-0001vI-8c@gemulon.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