From 5aae047e239c19264b61323865e8a4a1eae3e5f8 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Thu, 13 Oct 2005 22:55:19 +0000 Subject: [PATCH] Update krb_server_name to document that a missing entry defaults to 'localhost'. Improve kerberos error message. --- doc/src/sgml/config.sgml | 7 +++---- src/backend/libpq/auth.c | 10 +++++----- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index b64ba6c156..9e695bad57 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -1,5 +1,5 @@ Run-time Configuration @@ -596,9 +596,8 @@ SET ENABLE_SEQSCAN TO OFF; krb_srvname/krb_server_hostname@REALM. - If not set, the default is to allow any service principal matching an entry - in the keytab. See for details. - This parameter can only be set at server start. + If not set, the default is localhost. See + for details. This parameter can only be set at server start. diff --git a/src/backend/libpq/auth.c b/src/backend/libpq/auth.c index 403285438f..3bdddf86da 100644 --- a/src/backend/libpq/auth.c +++ b/src/backend/libpq/auth.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/libpq/auth.c,v 1.128 2005/10/08 19:32:57 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/libpq/auth.c,v 1.129 2005/10/13 22:55:19 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -162,11 +162,11 @@ pg_krb5_init(void) if (retval) { ereport(LOG, - (errmsg("Kerberos sname_to_principal(\"%s\") returned error %d", - pg_krb_srvnam, retval))); + (errmsg("Kerberos sname_to_principal(\"%s\", \"%s\") returned error %d", + khostname ? khostname : "localhost", pg_krb_srvnam, retval))); com_err("postgres", retval, - "while getting server principal for service \"%s\"", - pg_krb_srvnam); + "while getting server principal for server \"%s\" for service \"%s\"", + khostname ? khostname : "localhost", pg_krb_srvnam); krb5_kt_close(pg_krb5_context, pg_krb5_keytab); krb5_free_context(pg_krb5_context); return STATUS_ERROR; -- 2.40.0