diff options
author | Magnus Hagander | 2010-03-08 10:01:20 +0000 |
---|---|---|
committer | Magnus Hagander | 2010-03-08 10:01:20 +0000 |
commit | 19a9a5a15ac7251f79de9a8e6b6ad0c5884f239b (patch) | |
tree | 8a3c06a6d25ac16f3942d410f0a4f022902ead49 | |
parent | 6aff80e1bc3222d0cd07dcf02b38ffa5185cbf64 (diff) |
Require hostname to be set when using GSSAPI authentication. Without it,
the GSSAPI libraries crash.
Noted by Zdenek Kotala
-rw-r--r-- | src/interfaces/libpq/fe-auth.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/interfaces/libpq/fe-auth.c b/src/interfaces/libpq/fe-auth.c index f0d79487129..e93b5930d12 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.137 2008/01/31 18:58:30 tgl Exp $ + * $PostgreSQL: pgsql/src/interfaces/libpq/fe-auth.c,v 1.137.2.1 2010/03/08 10:01:20 mha Exp $ * *------------------------------------------------------------------------- */ @@ -452,6 +452,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, |