From: Noah Misch <noah@leadboat.com>
To: Michael Paquier <michael.paquier@gmail.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Daniele Varrazzo <daniele.varrazzo@gmail.com>
Cc: pgsql-bugs <pgsql-bugs@postgresql.org>
Subject: Re: [PATCH] Fixed malformed error message on malformed SCRAM message.
Date: Fri, 2 Jun 2017 05:57:42 +0000
Message-ID: <20170602055742.GA1502070@rfd.leadboat.com> (raw)
In-Reply-To: <CAB7nPqTBeEg1TFrZ+8uUWRnKVueDja+_LyTO2esPHRPQQQH8uQ@mail.gmail.com>
References: <CAB7nPqQrU1QyagF0i0MVw5_Cxy+YF+kJj5m8X5+qnNawn_UJuQ@mail.gmail.com>
<20170529214021.kaw5qjzsbofaa6re@alvherre.pgsql>
<CAB7nPqTBeEg1TFrZ+8uUWRnKVueDja+_LyTO2esPHRPQQQH8uQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
On Tue, May 30, 2017 at 04:39:55PM -0700, Michael Paquier wrote:
> On Mon, May 29, 2017 at 2:40 PM, Alvaro Herrera
> <alvherre@2ndquadrant.com> wrote:
> > Michael Paquier wrote:
> >> On Mon, May 29, 2017 at 2:06 PM, Alvaro Herrera
> >> <alvherre@2ndquadrant.com> wrote:
> >> > These messages look all wrong to me.
> >>
> >> So your complain would be to do the following for each error message
> >> that uses parenthesis to include details? Like that I suppose:
> >> --- a/src/backend/libpq/auth-scram.c
> >> +++ b/src/backend/libpq/auth-scram.c
> >> @@ -283,11 +283,13 @@ pg_be_scram_exchange(void *opaq, char *input,
> >> int inputlen,
> >> if (inputlen == 0)
> >> ereport(ERROR,
> >> (errcode(ERRCODE_PROTOCOL_VIOLATION),
> >> - (errmsg("malformed SCRAM message (empty message)"))));
> >> + errmsg("malformed SCRAM message"),
> >> + errdetail("Empty message.")));
> >
> > Yeah, but along the lines of errdetail("The message is empty.")
>
> Okay. What do you think about the attached patch then? Does it address
> your concerns about the format of those error messages?
> --
> Michael
> diff --git a/src/backend/libpq/auth-scram.c b/src/backend/libpq/auth-scram.c
> index 99feb0ce94..366a11feb8 100644
> --- a/src/backend/libpq/auth-scram.c
> +++ b/src/backend/libpq/auth-scram.c
> @@ -283,11 +283,13 @@ pg_be_scram_exchange(void *opaq, char *input, int inputlen,
> if (inputlen == 0)
> ereport(ERROR,
> (errcode(ERRCODE_PROTOCOL_VIOLATION),
> - (errmsg("malformed SCRAM message (empty message)"))));
> + errmsg("malformed SCRAM message"),
> + errdetail("The message is empty.")));
> if (inputlen != strlen(input))
> ereport(ERROR,
> (errcode(ERRCODE_PROTOCOL_VIOLATION),
> - (errmsg("malformed SCRAM message (length mismatch)"))));
> + errmsg("malformed SCRAM message"),
> + errdetail("Input length does not match.")));
auth.c uses COMMERROR for this sort of thing; why does auth-scram.c use ERROR?
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: noah@leadboat.com, michael.paquier@gmail.com, alvherre@2ndquadrant.com, daniele.varrazzo@gmail.com
Subject: Re: [PATCH] Fixed malformed error message on malformed SCRAM message.
In-Reply-To: <20170602055742.GA1502070@rfd.leadboat.com>
References: <CAB7nPqQrU1QyagF0i0MVw5_Cxy+YF+kJj5m8X5+qnNawn_UJuQ@mail.gmail.com> <20170529214021.kaw5qjzsbofaa6re@alvherre.pgsql> <CAB7nPqTBeEg1TFrZ+8uUWRnKVueDja+_LyTO2esPHRPQQQH8uQ@mail.gmail.com> <20170602055742.GA1502070@rfd.leadboat.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox