aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMagnus Hagander <magnus@hagander.net>2010-03-08 10:01:12 +0000
committerMagnus Hagander <magnus@hagander.net>2010-03-08 10:01:12 +0000
commit2a0dec7888af165f48e5aa94b0262f8c0ac050b6 (patch)
tree36d0c880c635919f524ce14a9c150f0b5485cdd8 /src
parent6c6ee75ad352fc586c14ec94eb2cb772bc37d233 (diff)
downloadpostgresql-2a0dec7888af165f48e5aa94b0262f8c0ac050b6.tar.gz
postgresql-2a0dec7888af165f48e5aa94b0262f8c0ac050b6.zip
Require hostname to be set when using GSSAPI authentication. Without it,
the GSSAPI libraries crash. Noted by Zdenek Kotala
Diffstat (limited to 'src')
-rw-r--r--src/interfaces/libpq/fe-auth.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/interfaces/libpq/fe-auth.c b/src/interfaces/libpq/fe-auth.c
index fcb5e316640..65f3e2625c0 100644
--- a/src/interfaces/libpq/fe-auth.c
+++ b/src/interfaces/libpq/fe-auth.c
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/interfaces/libpq/fe-auth.c,v 1.143 2010/01/02 16:58:11 momjian Exp $
+ * $PostgreSQL: pgsql/src/interfaces/libpq/fe-auth.c,v 1.144 2010/03/08 10:01:12 mha Exp $
*
*-------------------------------------------------------------------------
*/
@@ -426,6 +426,12 @@ pg_GSS_startup(PGconn *conn)
int maxlen;
gss_buffer_desc temp_gbuf;
+ if (!conn->pghost)
+ {
+ printfPQExpBuffer(&conn->errorMessage, libpq_gettext("host name must be specified\n"));
+ return STATUS_ERROR;
+ }
+
if (conn->gctx)
{
printfPQExpBuffer(&conn->errorMessage,