Re: [BUGS] [PATCH] Fixed malformed error message on malformed SCRAMmessage. - Mailing list pgsql-bugs

From Heikki Linnakangas
Subject Re: [BUGS] [PATCH] Fixed malformed error message on malformed SCRAMmessage.
Date
Msg-id 3cc82687-ee65-d0f0-efc2-ddad60ab206f@iki.fi
Whole thread Raw
In response to Re: [BUGS] [PATCH] Fixed malformed error message on malformed SCRAMmessage.  (Noah Misch <noah@leadboat.com>)
Responses Re: [BUGS] [PATCH] Fixed malformed error message on malformed SCRAM message.  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-bugs
On 06/02/2017 09:32 AM, Noah Misch wrote:
> On Fri, Jun 02, 2017 at 02:20:00AM -0400, Tom Lane wrote:
>> BTW, since you mention COMMERROR uses in auth.c, isn't the usage at
>> line 687 wrong?  It sure looks like the author supposed that that
>> ereport call wouldn't return, but it will.  Adjacent similar calls
>> clean up and return NULL.
>
> Probably, though one could argue for proceeding with the short password.
> Deserves a comment if log-only is intentional.

Let's turn it into an ERROR.

> The lack of an exit after COMMERROR "client selected an invalid SASL
> authentication mechanism" looks like a bug.

Yes. That was fixed in commit 505b5d2f86 already.

Taking all the comments in this thread into account, and a few more 
things that I spotted while looking at the error messages, I came up 
with the attached patch. It includes the changes from Michael's patch 
upthread to use errdetail() in the SCRAM errors, and it turns the 
protocol violation errors in auth.c from COMMERROR into ERROR. See 
commit message for more details. Barring objections, I'll push this 
tomorrow.

- Heikki


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Attachment

pgsql-bugs by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: [BUGS] BUG #14693: create materialized view forces btrim
Next
From: Joe Conway
Date:
Subject: Re: [BUGS] BUG #14682: row level security not work with partitionedtable