Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1al1up-0004Mk-Fu for pgsql-bugs@arkaria.postgresql.org; Tue, 29 Mar 2016 22:15:11 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1al1uo-0003S6-2h for pgsql-bugs@arkaria.postgresql.org; Tue, 29 Mar 2016 22:15:10 +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 1al1uA-00023g-19; Tue, 29 Mar 2016 22:14:30 +0000 Received: from smtp-auth.no-ip.com ([8.23.224.61] helo=out.smtp-auth.no-ip.com) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1al1u2-0005KG-IU; Tue, 29 Mar 2016 22:14:28 +0000 X-No-IP: alvh.no-ip.org@noip-smtp X-Report-Spam-To: abuse@no-ip.com Received: from alvin.alvh.no-ip.org (unknown [200.83.202.40]) (Authenticated sender: alvh.no-ip.org@noip-smtp) by smtp-auth.no-ip.com (Postfix) with ESMTPA id 28BD640093B; Tue, 29 Mar 2016 15:14:16 -0700 (PDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id A50EE5D8; Tue, 29 Mar 2016 19:14:13 -0300 (CLT) Date: Tue, 29 Mar 2016 19:14:13 -0300 From: Alvaro Herrera To: Tom Lane Cc: Christian Ullrich , Magnus Hagander , "pgsql-bugs@postgresql.org" , "pgsql-hackers@postgresql.org" Subject: Re: Re: [HACKERS] BUG #13854: SSPI authentication failure: wrong realm name used Message-ID: <20160329221413.GA929448@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <30297.1459288325@sss.pgh.pa.us> User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -1.1 (-) 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 Tom Lane wrote: > Alvaro Herrera writes: > > So, it seems that ClientAuthentication() expects to raise ereport(FATAL) > > in case of authentication failures. But what's the code path that > > causes that to happen if a ereport(ERROR) happens in there? Because all > > that code is pretty careful to not do ereport(ERROR) directly and > > instead return STATUS_ERROR which makes ClientAuthentication do the > > FATAL report. If this doesn't matter, then isn't this whole code overly > > complicated for no reason? > > The reason why elog(ERROR) will become a FATAL is that no outer setjmp > has been executed yet, so elog.c will realize it has noplace to longjmp > to. Ah, I was looking callers up-stack and found nothing. That should have cued me that that was happening :-) > Anyway, as things stand, elog(ERROR) will abort the session safely but > you won't necessarily get the kind of logging you want, so expected > auth-failure cases should try to go the STATUS_ERROR route. In other words, the use of palloc() and friends (psprintf in the patch) should be acceptable here. -- Álvaro Herrera http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs