Re: Postmaster crashes on SIGHUP when oauth_validator_libraries holds only whitespace

From: Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>, Grigorev Jurij <ju(dot)grigorev(at)ftdata(dot)ru>
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-14 21:28:30
Message-ID: CAOYmi+=JYJaAuPAcHYNptOQJaLHM5i6ex_wH0aS4QP9ngukX2A@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, Sep 14, 2026 at 4:28 AM Daniel Gustafsson <daniel(at)yesql(dot)se> wrote:
> Thanks for the report, that does indeed seem like the right fix.

Yes, thanks! Couple thoughts on specific pieces:

> + /*
> + * 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.

> +is($bgconn->query_safe('SELECT 1'), '1',
> + 'postmaster survives an empty OAuth validator list on reload');

query_safe() doesn't return on failure, so IMO we shouldn't wrap it in is().

--

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.

Thanks,
--Jacob

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Daniel Gustafsson 2026-09-14 21:34:08 Re: Postmaster crashes on SIGHUP when oauth_validator_libraries holds only whitespace
Previous Message Ayush Tiwari 2026-09-14 19:07:42 Re: BUG #19687: ALTER SEQUENCE provokes error XX001 could not read blocks