Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dJ0nR-00024N-7l for pgsql-bugs@arkaria.postgresql.org; Thu, 08 Jun 2017 17:00:33 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dJ0nQ-0000YW-Jv for pgsql-bugs@arkaria.postgresql.org; Thu, 08 Jun 2017 17:00:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dJ0nP-0000Y6-UJ for pgsql-bugs@postgresql.org; Thu, 08 Jun 2017 17:00:31 +0000 Received: from mail-lf0-x242.google.com ([2a00:1450:4010:c07::242]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dJ0nN-0003bR-Js for pgsql-bugs@postgresql.org; Thu, 08 Jun 2017 17:00:31 +0000 Received: by mail-lf0-x242.google.com with SMTP id v20so3517317lfa.2 for ; Thu, 08 Jun 2017 10:00:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=J09R6uJU/xisXL1psHW06Ltz034/nsZPQEm8saaYyPg=; b=ZLSC6K0+dQXrik/ZF3C2DaQeN2gP9mgDYUsZuVOHCXpG6XHUVUSzS/+JKsBeCthncT /6J8xfvAqk+aiX2gSPpadvaLBW0i5GfMWxT2Z/P5XAXJWK91klYLjzJeSoTeYRukTQBS tYNWo+kZPP/tP5YOy5IZ0ULPOVeCpIUjmpmu0NZhzBoIHaes0x/seqMwM+5+mCnXI7h+ mk/Ab/8E3O94kc0J4uYzx/EjWS16t4TQNpAPVS/S8K/nCgnhVoEdiaehg7X45SIzFdFL AWxyBouMrB/diZ6ADC/wv9RsDsgApGey91PsFIdzV0Q/koueAWLcVeftWwWWmpOosNIl mtKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:cc:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=J09R6uJU/xisXL1psHW06Ltz034/nsZPQEm8saaYyPg=; b=OoxzqgzPYTvioVPTz8bQkvZvTFrjan0r89/Nqb5raiPNt7dy4WytwoXWCS7UpWCVTp SJJWrvK4SsM4F9pR+aCiHIK3nJ8Qaeca7rMEEJspYbr2Yu/ekoH9HTiFbg1hYPpTEOgK ennygbKZ3pz3NAY2WveXqJj0nLiBnpQ/m9vYW0qlYIGeEzAdiH4KnAfGqJrZ+IPPV1MN uiY/REPp+VeRiOEP+GqFB9RR7S+SBrU7W0M5nsjtQNVPSlqxlkqUVa8YTPCFdF34qbYr MTUMzBoLjKQUiLHG9jD584m70d/i/9LqwLhxGOFW4kk8UkhoxAA+bfIXgSQWEWWRRieo e8qw== X-Gm-Message-State: AODbwcArz+gTmYDZ2q5bd9Rx9HGAWCw/Qg4oL/L1dKlVbrPmKm5Vihea HqD99iMKy+QXLIXW X-Received: by 10.46.6.26 with SMTP id 26mr11535005ljg.29.1496941228557; Thu, 08 Jun 2017 10:00:28 -0700 (PDT) Received: from [192.168.1.99] (dsl-hkibng32-54fb4e-103.dhcp.inet.fi. [84.251.78.103]) by smtp.gmail.com with ESMTPSA id d10sm1112549lfb.38.2017.06.08.10.00.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Jun 2017 10:00:27 -0700 (PDT) Subject: Re: [PATCH] Fixed malformed error message on malformed SCRAM message. To: Michael Paquier References: <20170529214021.kaw5qjzsbofaa6re@alvherre.pgsql> <20170602055742.GA1502070@rfd.leadboat.com> <27186.1496384400@sss.pgh.pa.us> <20170602063216.GE1500331@rfd.leadboat.com> <3cc82687-ee65-d0f0-efc2-ddad60ab206f@iki.fi> Cc: Noah Misch , Tom Lane , Alvaro Herrera , Daniele Varrazzo , pgsql-bugs From: Heikki Linnakangas Message-ID: Date: Thu, 8 Jun 2017 20:00:26 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.5 (-) 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 06/08/2017 03:07 AM, Michael Paquier wrote: > On Wed, Jun 7, 2017 at 11:48 PM, Heikki Linnakangas wrote: >> On 06/02/2017 09:32 AM, Noah Misch 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. > > Shouldn't that portion be back-patched? Yeah, perhaps. But since it's not actively broken, nothing particularly bad happens with the code as it is, I think I'm not going to bother. >>> 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. > > Thanks for the new version. No additional comments from me. Ok, committed, thanks! - Heikki -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs