*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/libpq/auth.c,v 1.178 2009/01/09 10:13:18 mha Exp $
+ * $PostgreSQL: pgsql/src/backend/libpq/auth.c,v 1.179 2009/03/22 18:06:35 tgl Exp $
*
*-------------------------------------------------------------------------
*/
*/
#ifdef ENABLE_SSPI
static void
-pg_SSPI_error(int severity, char *errmsg, SECURITY_STATUS r)
+pg_SSPI_error(int severity, const char *errmsg, SECURITY_STATUS r)
{
char sysmsg[256];
- if (FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, r, 0, sysmsg, sizeof(sysmsg), NULL) == 0)
+ if (FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, r, 0,
+ sysmsg, sizeof(sysmsg), NULL) == 0)
ereport(severity,
(errmsg_internal("%s", errmsg),
errdetail("SSPI error %x", (unsigned int) r)));
&sspicred,
&expiry);
if (r != SEC_E_OK)
- pg_SSPI_error(ERROR,
- gettext_noop("could not acquire SSPI credentials handle"), r);
+ pg_SSPI_error(ERROR, _("could not acquire SSPI credentials"), r);
/*
* Loop through SSPI message exchange. This exchange can consist of
}
FreeCredentialsHandle(&sspicred);
pg_SSPI_error(ERROR,
- gettext_noop("could not accept SSPI security context"), r);
+ _("could not accept SSPI security context"), r);
}
if (sspictx == NULL)
{
FreeLibrary(secur32);
pg_SSPI_error(ERROR,
- gettext_noop("could not get security token from context"), r);
+ _("could not get token from SSPI security context"), r);
}
FreeLibrary(secur32);
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/interfaces/libpq/fe-auth.c,v 1.140 2009/01/13 10:43:21 mha Exp $
+ * $PostgreSQL: pgsql/src/interfaces/libpq/fe-auth.c,v 1.141 2009/03/22 18:06:35 tgl Exp $
*
*-------------------------------------------------------------------------
*/
*/
static void
-pg_SSPI_error(PGconn *conn, char *mprefix, SECURITY_STATUS r)
+pg_SSPI_error(PGconn *conn, const char *mprefix, SECURITY_STATUS r)
{
char sysmsg[256];
if (FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, r, 0,
sysmsg, sizeof(sysmsg), NULL) == 0)
- printfPQExpBuffer(&conn->errorMessage, "%s: sspi error %x",
+ printfPQExpBuffer(&conn->errorMessage, "%s: SSPI error %x",
mprefix, (unsigned int) r);
else
printfPQExpBuffer(&conn->errorMessage, "%s: %s (%x)",
return STATUS_ERROR;
}
- r = AcquireCredentialsHandle(NULL, use_negotiate ? "negotiate" : "kerberos", SECPKG_CRED_OUTBOUND, NULL, NULL, NULL, NULL, conn->sspicred, &expire);
+ r = AcquireCredentialsHandle(NULL,
+ use_negotiate ? "negotiate" : "kerberos",
+ SECPKG_CRED_OUTBOUND,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ conn->sspicred,
+ &expire);
if (r != SEC_E_OK)
{
- pg_SSPI_error(conn, "acquire credentials failed", r);
+ pg_SSPI_error(conn, libpq_gettext("could not acquire SSPI credentials"), r);
free(conn->sspicred);
conn->sspicred = NULL;
return STATUS_ERROR;