Don't send an empty SSPI negotiation packet at the end of the negotiation.

Fixes bug #3750
REL8_3_STABLE
Magnus Hagander 18 years ago
parent 4c128303e0
commit 024014a448
  1. 9
      src/interfaces/libpq/fe-auth.c

@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-auth.c,v 1.133 2007/11/15 21:14:46 momjian Exp $ * $PostgreSQL: pgsql/src/interfaces/libpq/fe-auth.c,v 1.134 2007/12/04 13:02:53 mha Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -618,12 +618,19 @@ pg_SSPI_continue(PGconn *conn)
return STATUS_ERROR; return STATUS_ERROR;
} }
/*
* If the negotiation is complete, there may be zero bytes to send. The server is
* at this point not expecting any more data, so don't send it.
*/
if (outbuf.pBuffers[0].cbBuffer > 0)
{
if (pqPacketSend(conn, 'p', if (pqPacketSend(conn, 'p',
outbuf.pBuffers[0].pvBuffer, outbuf.pBuffers[0].cbBuffer)) outbuf.pBuffers[0].pvBuffer, outbuf.pBuffers[0].cbBuffer))
{ {
FreeContextBuffer(outbuf.pBuffers[0].pvBuffer); FreeContextBuffer(outbuf.pBuffers[0].pvBuffer);
return STATUS_ERROR; return STATUS_ERROR;
} }
}
FreeContextBuffer(outbuf.pBuffers[0].pvBuffer); FreeContextBuffer(outbuf.pBuffers[0].pvBuffer);
} }

Loading…
Cancel
Save