]> granicus.if.org Git - postgresql/commitdiff
Require hostname to be set when using GSSAPI authentication. Without it,
authorMagnus Hagander <magnus@hagander.net>
Mon, 8 Mar 2010 10:01:24 +0000 (10:01 +0000)
committerMagnus Hagander <magnus@hagander.net>
Mon, 8 Mar 2010 10:01:24 +0000 (10:01 +0000)
the GSSAPI libraries crash.

Noted by Zdenek Kotala

src/interfaces/libpq/fe-auth.c

index a41242ba0460d56074ed07b655cd18e17ee8b02f..71959fac8b09638accfca623c341c3bb1fe6ee29 100644 (file)
@@ -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.142 2009/06/11 14:49:13 momjian Exp $
+ *       $PostgreSQL: pgsql/src/interfaces/libpq/fe-auth.c,v 1.142.2.1 2010/03/08 10:01:24 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,