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

Started by Christophe Courtoisabout 8 years ago5 messagesbugs
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:

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