Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dGfaq-0001ZK-6k for pgsql-bugs@arkaria.postgresql.org; Fri, 02 Jun 2017 05:57:52 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dGfao-0007Cs-Ic for pgsql-bugs@arkaria.postgresql.org; Fri, 02 Jun 2017 05:57:50 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dGfan-0007CI-Ox for pgsql-bugs@postgresql.org; Fri, 02 Jun 2017 05:57:49 +0000 Received: from mail-pf0-x22b.google.com ([2607:f8b0:400e:c00::22b]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dGfal-000807-8t for pgsql-bugs@postgresql.org; Fri, 02 Jun 2017 05:57:48 +0000 Received: by mail-pf0-x22b.google.com with SMTP id e193so47530257pfh.0 for ; Thu, 01 Jun 2017 22:57:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=VRdN0rQUrLT2o52T1I+bDlMbZTs/m2nm/7FkoHL2vRU=; b=PngQL6N/vHFW6Wpb3mlybY9EX7WPTYg1PQ/kxkkYoTpDZQV96zGCN93kIZ5Jiy1vGM vxWpPvLhn3hazJ1kgJ44Mfg1paBvFs6RL6tV5fkhEbGbz9qZOOf/zYFHhu8Yx4ZSZEGY e7OKawYT82PJyiFxePTikqrMJptJD1Z+UsJLc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=VRdN0rQUrLT2o52T1I+bDlMbZTs/m2nm/7FkoHL2vRU=; b=hnEsnfDpOsQ+OqE94LeRC0uU0b0FJ3scC6/ZXrXrYq+/1sYIlbt71Qd1fEf4L/T+Ul fLZVOclPadmlS5XQBoLXVFQAFuZy5is2by6F/bf1z+xJEqTZPQFaXd5yPPed7gpFXv03 OcR3PFcdYE1dU3M+t71n/1Nf00PRNtqWRhr9+aLU+mN++QZiQe0IsoZwTPrvWL8crgoM cziXgmjc7ROv/jrEOJuwgcUxdNc9wMRbWT0zM+9nrR4SwOCnfOlGDTlGPxbkYbz2FK5A V3aKZKzKlwYOF9V7az8utQxVH3V0EkEN0Y6b/JVs7SvYKA63LeD+lUSy9rVMSMRYiDT1 Dxsw== X-Gm-Message-State: AODbwcCk3E/KgBv3gFMYDYOhCvM1lN7jEst8FYDFAwUBaqsE70r/mmq+ mAI04BlEczKT+AKr X-Received: by 10.84.131.67 with SMTP id 61mr99153545pld.8.1496383065737; Thu, 01 Jun 2017 22:57:45 -0700 (PDT) Received: from rfd.leadboat.com (c-73-158-248-138.hsd1.ca.comcast.net. [73.158.248.138]) by smtp.gmail.com with ESMTPSA id m75sm2243712pfi.77.2017.06.01.22.57.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Jun 2017 22:57:44 -0700 (PDT) Date: Fri, 2 Jun 2017 05:57:42 +0000 From: Noah Misch To: Michael Paquier Cc: Alvaro Herrera , Daniele Varrazzo , pgsql-bugs Subject: Re: [PATCH] Fixed malformed error message on malformed SCRAM message. Message-ID: <20170602055742.GA1502070@rfd.leadboat.com> References: <20170529214021.kaw5qjzsbofaa6re@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On Tue, May 30, 2017 at 04:39:55PM -0700, Michael Paquier wrote: > On Mon, May 29, 2017 at 2:40 PM, Alvaro Herrera > wrote: > > Michael Paquier wrote: > >> On Mon, May 29, 2017 at 2:06 PM, Alvaro Herrera > >> 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