From: Nathan Bossart <nathandbossart@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: pgsql-hackers@postgresql.org
Subject: Re: pg_parameter_aclcheck() and trusted extensions
Date: Thu, 7 Jul 2022 11:40:01 -0700
Message-ID: <20220707184001.GA2255643@nathanxps13> (raw)
In-Reply-To: <2995921.1657212060@sss.pgh.pa.us>
References: <20220706224727.GA2158260@nathanxps13>
<YsYxEtX8zOYKf3Ru@paquier.xyz>
<2995921.1657212060@sss.pgh.pa.us>
On Thu, Jul 07, 2022 at 12:41:00PM -0400, Tom Lane wrote:
> Yeah. So the fix here seems pretty obvious: rather than applying the
> permissions check using bare GetUserId(), we need to remember the role
> OID that originally applied the setting, and use that.
Please ignore my previous message. This makes sense.
> The problem with this sketch is that
>
> (1) we need an OID field in struct config_generic, as well as GucStack,
> which means an ABI break for any extensions that look directly at GUC
> records. There probably aren't many, but ...
>
> (2) we need an additional parameter to set_config_option, which
> again is a compatibility break for anything calling that directly.
> There surely are such callers --- our own extensions do it.
>
> Can we get away with doing these things in beta3? We could avoid
> breaking (2) in the v15 branch by making set_config_option into
> a wrapper around set_config_option_ext, or something like that;
> but the problem with struct config_generic seems inescapable.
> (Putting the new field at the end would solve nothing, since
> config_generic is embedded into larger structs.)
>
> The alternative to API/ABI breaks seems to be to revert the
> feature, which would be sad.
I personally lean more towards the compatibility break than reverting the
feature. There are still a couple of months before 15.0, and I suspect it
won't be too difficult to fix any extensions that break because of this.
--
Nathan Bossart
Amazon Web Services: https://aws.amazon.com
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-hackers@postgresql.org
Cc: nathandbossart@gmail.com, tgl@sss.pgh.pa.us, michael@paquier.xyz
Subject: Re: pg_parameter_aclcheck() and trusted extensions
In-Reply-To: <20220707184001.GA2255643@nathanxps13>
* 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