Kerberos code overwrites it's own error message

From: "Magnus Hagander" <mha(at)sollentuna(dot)net>
To: <pgsql-hackers(at)postgresql(dot)org>
Cc: "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org>
Subject: Kerberos code overwrites it's own error message
Date: 2005-03-15 16:54:28
Message-ID: 6BCB9D8A16AC4241919521715F4D8BCE6C708A@algol.sollentuna.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

interfaces/libpq/fe-auth, line 621-622:
<<snip>>
if (pg_krb5_sendauth(PQerrormsg, conn->sock,

hostname) != STATUS_OK)
{
snprintf(PQerrormsg, PQERRORMSG_LENGTH,
libpq_gettext("Kerberos 5
authentication failed\n"));
pgunlock_thread();
return STATUS_ERROR;
}
<<snip>>

It appears that libpq overwrites the actual error message from the
kerberos libraries with a generic "Kerberos 5 authentication failed"
message (PQerrormsg is passed in just for the reason of collecting the
error msg).'

Removing the snprintf() at these lines starts producing actual error
messages, which sure are helpful when it comes to debugging...

I've hacked around enough in those parts that I can't produce a clean
patch right now, but it should be easy enough to spot and fix without,
I'd think :-) If an actual patch is needed, I can provide one soon, but
I figured I should get the mail out there first...

Please consider fixing this in both 8.1 and 8.0.2.

//Magnus

Browse pgsql-hackers by date

  From Date Subject
Next Message PFC 2005-03-15 17:17:31 Re: [PERFORM] Avoiding tuple construction/deconstruction during joining
Previous Message Greg Stark 2005-03-15 16:53:43 Re: invalidating cached plans

Browse pgsql-patches by date

  From Date Subject
Next Message Thomas Hallgren 2005-03-15 18:07:42 Fix that deals with unusable custom variables.
Previous Message Tom Lane 2005-03-15 05:52:03 Re: [HACKERS] [ADMIN] invalid multibyte character for locale