Re: Sloppy SSPI error reporting code - Mailing list pgsql-hackers

From Noah Misch
Subject Re: Sloppy SSPI error reporting code
Date
Msg-id 20150402054459.GA1127153@tornado.leadboat.com
Whole thread Raw
In response to Re: Sloppy SSPI error reporting code  (Bruce Momjian <bruce@momjian.us>)
Responses Re: Sloppy SSPI error reporting code
List pgsql-hackers
On Wed, Apr 01, 2015 at 10:49:01PM -0400, Bruce Momjian wrote:
> On Sat, Jan 10, 2015 at 02:53:13PM -0500, Tom Lane wrote:
> > While looking at fe-auth.c I noticed quite a few places that weren't
> > bothering to make error messages localizable (ie, missing libpq_gettext
> > calls), and/or were failing to add a trailing newline as expected in
> > libpq error messages.  Perhaps these are intentional but I doubt it.
> > Most of the instances seemed to be SSPI-related.
> > 
> > I have no intention of fixing these myself, but whoever committed that
> > code should take a second look.
> 
> I looked through that file and only found two cases;  patch attached.

Tom mentioned newline omissions, which you'll find in pg_SSPI_error().

> !             printfPQExpBuffer(&conn->errorMessage, libpq_gettext("SSPI returned invalid number of output
buffers\n"));
> !                      libpq_gettext("fe_sendauth: error sending password authentication\n"));

The first message is too internals-focused for a translation to be useful.  If
it were in the backend, we would use elog() and not translate.  The second is
a non-actionable message painting over a wide range of specific failures;
translating it would just put lipstick on the pig.



pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: Additional role attributes && superuser review
Next
From: Amit Kapila
Date:
Subject: Re: Parallel Seq Scan