Skip to content
Snippets Groups Projects
Commit 2af53f37 authored by Tom Lane's avatar Tom Lane
Browse files

After closing frontend socket, set MyProcPort->sock = -1 to ensure that

subsequent I/O attempts fail cleanly.  I'm speculating about failure
scenarios in which we do pq_close, then something in a proc_exit routine
opens a file (re-using that kernel FD number), then something else
fails and tries to write an elog message to the frontend ... message
ends up in opened file, oops.  No known examples of this but it seems
like a potential hole.
parent 39725e56
No related branches found
No related tags found
No related merge requests found
......@@ -29,7 +29,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: pqcomm.c,v 1.91 2000/05/21 21:19:53 tgl Exp $
* $Id: pqcomm.c,v 1.92 2000/05/26 01:26:19 tgl Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -144,7 +144,11 @@ void
pq_close(void)
{
if (MyProcPort != NULL)
{
close(MyProcPort->sock);
/* make sure any subsequent attempts to do I/O fail cleanly */
MyProcPort->sock = -1;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment