Re: Postmaster crashes on SIGHUP when oauth_validator_libraries holds only whitespace

From: Grigorev Jurij <ju(dot)grigorev(at)ftdata(dot)ru>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>, Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com>
Cc: "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: Postmaster crashes on SIGHUP when oauth_validator_libraries holds only whitespace
Date: 2026-09-15 02:55:55
Message-ID: c7e77341b94e406bb77e8cd3367cae59@localhost.localdomain
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi Jacob, Daniel,

Thanks for the review! In the attached v2 I removed the explanatory
comment and call query_safe() directly. The functional change and the
reload test are otherwise unchanged.

Also left the validator-name canonicalization issue out of this patch.

Checked, the patch builds cleanly against master with --enable-cassert,
and PG_TEST_EXTRA=oauth make check in src/test/modules/oauth_validator
passes all 190 tests.

Regards,
Yuriy
________________________________________
От: Daniel Gustafsson <daniel(at)yesql(dot)se>
Отправлено: 15 сентября 2026 г. 4:34:08
Кому: Jacob Champion
Копия: Григорьев Юрий; pgsql-bugs(at)lists(dot)postgresql(dot)org
Тема: Re: Postmaster crashes on SIGHUP when oauth_validator_libraries holds only whitespace

> On 14 Sep 2026, at 23:28, Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com> wrote:

>> + /*
>> + * An empty or all-whitespace setting is accepted by
>> + * SplitDirectoriesString(), which returns an empty list for it, so the
>> + * parse result has to be checked rather than the raw string.
>> + */
>
> Sometimes recording a historical bug in the comments can help prevent
> future mistakes... but I don't think this is one of those cases,
> especially since the new test prevents accidental regression.

+1

> This seems like a good time to mention that I have a checklist item to
> fix the following (shouldn't block this patch):
>
>> if (!SplitDirectoriesString(rawstring, ',', &elemlist))
>> ...
>> if (strcmp(allowed, hbaline->oauth_validator) == 0)
>
> SplitDirectoriesString() canonicalizes its outputs, which we then
> compare against the uncanonicalized hbaline->oauth_validator. That
> could lead to annoying false negatives in more complicated setups.

Right, this patch wont move the needle in the wrong direction for future fixes
AFAICT.

--
Daniel Gustafsson

Attachment Content-Type Size
v2-0001-Fix-postmaster-crash-on-whitespace-only-oauth_valida.patch application/octet-stream 3.6 KB

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Andrey Rachitskiy 2026-09-15 04:26:02 Re: Detaching a child table makes an expression using it unrestorable
Previous Message Jinqing Kuang 2026-09-15 01:53:31 Re: Detaching a child table makes an expression using it unrestorable