Re: BUG #15708: RLS 'using' running as wrong user when called from a view

From: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: quae(at)daurnimator(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: BUG #15708: RLS 'using' running as wrong user when called from a view
Date: 2019-03-27 12:46:29
Message-ID: CAEZATCXm7x45myKcg4c+SbMVAVCeLtx9u5K2JhN2rJjWbKKOyQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On Mon, 25 Mar 2019 at 20:27, Stephen Frost <sfrost(at)snowman(dot)net> wrote:
>
> * Dean Rasheed (dean(dot)a(dot)rasheed(at)gmail(dot)com) wrote:
>
> > It looks like the best place to fix it is in
> > get_policies_for_relation(), since that's where all the policies to be
> > applied for a given RTE are pulled together. Patch attached.
>
> Yes, on a quick review, that looks like a good solution to me as well.
>

On second thoughts, it actually needs to be in
get_row_security_policies(), after making copies of the quals from the
policies, otherwise it would be scribbling on the copies from the
relcache. Actually that makes the code change a bit simpler too.

Regards,
Dean

Attachment Content-Type Size
rls-perm-check-fix-v2.patch text/x-patch 3.5 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2019-03-27 14:14:21 Re: BUG #15715: UPDATE using "in (subquery for update limit 1)" does not respect the limit in subquery
Previous Message Lars Vonk 2019-03-27 07:22:39 Re: BUG #15715: UPDATE using "in (subquery for update limit 1)" does not respect the limit in subquery

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2019-03-27 12:48:20 Re: Usage of epoch in txid_current
Previous Message Christoph Berg 2019-03-27 12:43:52 Re: pg_upgrade version checking questions