Re: Add a new BGWORKER_BYPASS_ROLELOGINCHECK flag

From: "Drouvot, Bertrand" <bertranddrouvot(dot)pg(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Add a new BGWORKER_BYPASS_ROLELOGINCHECK flag
Date: 2023-10-10 07:12:49
Message-ID: 2b530754-56c0-4272-a326-11d30a0bca55@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 10/10/23 7:58 AM, Michael Paquier wrote:
> On Tue, Oct 10, 2023 at 06:57:05AM +0200, Drouvot, Bertrand wrote:
>> Please find attached v9 (v8 rebase due to f483b2090).
>
> I was looking at v8 just before you sent this v9, and still got
> annoyed by the extra boolean argument added to InitPostgres().

Arf, I did not look at it as I had in mind to look at it once
this one is in.

> So
> please let me propose to bite the bullet and refactor that, as of the
> 0001 attached that means less diff footprints in all the callers of
> InitPostgres() (I am not wedded to the flag names).

Thanks for having looked at it!

+ bits32 init_flags = 0; /* never honor session_preload_libraries */

Also a few word about datallowconn in the comment? (as the flag deals with both).

>
> It looks like 0002 had the same issues as f483b209: the worker that
> could not be started because of the login restriction could be
> detected as stopped by worker_spi_launch(), causing the script to fail
> hard.
>
> 0002 is basically your v9, able to work with the refactoring from
> 0001.

Thanks!

#define INIT_PG_OVERRIDE_ALLOW_CONNS 0x0002
+#define INIT_PG_BYPASS_ROLE_LOGIN 0x0004

Any reason why INIT_PG_BYPASS_ROLE_LOGIN is not 0x0003?

Except that it does look good to me.

Regards,

--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Drouvot, Bertrand 2023-10-10 07:18:04 Re: Add a new BGWORKER_BYPASS_ROLELOGINCHECK flag
Previous Message Peter Eisentraut 2023-10-10 06:47:31 Re: Pre-proposal: unicode normalized text