pg_hba_file_rules: "scram-sha256" instead of "scram-sha-256"

Started by Christophe Courtoisover 8 years ago5 messagesbugs
Beta feature

Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.

won't retrysuccessCI history

You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:

docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t68142
psql -h localhost -U postgres

Built from patchset v2 (message #2), July 27, 2026 at 09:18 PM.

Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:

git clone --branch t68142_2 https://github.com/hackorum-dev/postgres.git

In a checkout you already have, add the fork once:

git remote add hackorum https://github.com/hackorum-dev/postgres.git

then, for this patchset and every later one:

git fetch hackorum t68142_2 && git checkout t68142_2

Patchset v2 (message #2) is on t68142_2

Jump to latest
#1Christophe Courtois
christophe.courtois@dalibo.com

Hi,

In pg_hba.conf, the new authentication method must be set as
"scram-sha-256".

But it appears as "scram-sha256" (only one hyphen) in pg_hba_file_rules.
This is a bit confusing.

"scram-sha256" appears in commit c727f120 in src/backend/libpq/hba.c,
while defining the array UserAuthName.

I've not seen why it should be this way in the associated discussions
(/messages/by-id/fde71ff1-5858-90c8-99a9-1c2427e7bafb@iki.fi
,
/messages/by-id/CAB7nPqS99Z31f7jhoYYMoBDbuZSQRpn+HQzByA=EwfMDYwCk1Q@mail.gmail.com)

Is it just a remnant of previous versions of the patch or is there a
reason?

--
Christophe Courtois
Consultant Dalibo
http://dalibo.com/ - http://dalibo.org/

#2Michael Paquier
michael@paquier.xyz
In reply to: Christophe Courtois (#1)
Re: pg_hba_file_rules: "scram-sha256" instead of "scram-sha-256"

On Fri, Jan 26, 2018 at 05:22:59PM +0100, Christophe Courtois wrote:

But it appears as "scram-sha256" (only one hyphen) in pg_hba_file_rules.
This is a bit confusing.

Thanks for the report. That's a bug.. Likely from some incorrect
rebase during the feature review.

"scram-sha256" appears in commit c727f120 in src/backend/libpq/hba.c,
while defining the array UserAuthName.

Is it just a remnant of previous versions of the patch or is there a
reason?

Attached is a patch for that. At the same time I have noticed that
protocol.sgml is using the same name, so I would suggest to fix that at
the same time. That introduces a small user-visible change when using
pg_hba_file_rules still that should be backpatched.
--
Michael

Attachments:

t68142_2
scram-hba-fix.patchtext/x-diff; charset=us-asciiDownload+2-2
#3Peter Eisentraut
peter_e@gmx.net
In reply to: Michael Paquier (#2)
Re: pg_hba_file_rules: "scram-sha256" instead of "scram-sha-256"

On 1/26/18 18:44, Michael Paquier wrote:

"scram-sha256" appears in commit c727f120 in src/backend/libpq/hba.c,
while defining the array UserAuthName.

Is it just a remnant of previous versions of the patch or is there a
reason?

Attached is a patch for that. At the same time I have noticed that
protocol.sgml is using the same name, so I would suggest to fix that at
the same time. That introduces a small user-visible change when using
pg_hba_file_rules still that should be backpatched.

Committed and backpatched, and I also fixed the names of the internal
symbols analogously.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

#4Michael Paquier
michael@paquier.xyz
In reply to: Peter Eisentraut (#3)
Re: pg_hba_file_rules: "scram-sha256" instead of "scram-sha-256"

On Tue, Jan 30, 2018 at 05:07:20PM -0500, Peter Eisentraut wrote:

Committed and backpatched, and I also fixed the names of the internal
symbols analogously.

Thanks, Peter. Please note I did not want to bother about them as it is
never fun to potentially break compilation for any client tools using
them with a minor upgrade, particularly on REL_10_STABLE...
--
Michael

#5Peter Eisentraut
peter_e@gmx.net
In reply to: Michael Paquier (#4)
Re: pg_hba_file_rules: "scram-sha256" instead of "scram-sha-256"

On 1/30/18 17:56, Michael Paquier wrote:

On Tue, Jan 30, 2018 at 05:07:20PM -0500, Peter Eisentraut wrote:

Committed and backpatched, and I also fixed the names of the internal
symbols analogously.

Thanks, Peter. Please note I did not want to bother about them as it is
never fun to potentially break compilation for any client tools using
them with a minor upgrade, particularly on REL_10_STABLE...

These are just internal macros. Nobody else should be using them.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services