Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2af53f3

Browse files
committed
After closing frontend socket, set MyProcPort->sock = -1 to ensure that
subsequent I/O attempts fail cleanly. I'm speculating about failurescenarios in which we do pq_close, then something in a proc_exit routineopens a file (re-using that kernel FD number), then something elsefails and tries to write an elog message to the frontend ... messageends up in opened file, oops. No known examples of this but it seemslike a potential hole.
1 parent39725e5 commit2af53f3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

‎src/backend/libpq/pqcomm.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
3030
* Portions Copyright (c) 1994, Regents of the University of California
3131
*
32-
*$Id: pqcomm.c,v 1.91 2000/05/21 21:19:53 tgl Exp $
32+
*$Id: pqcomm.c,v 1.92 2000/05/26 01:26:19 tgl Exp $
3333
*
3434
*-------------------------------------------------------------------------
3535
*/
@@ -144,7 +144,11 @@ void
144144
pq_close(void)
145145
{
146146
if (MyProcPort!=NULL)
147+
{
147148
close(MyProcPort->sock);
149+
/* make sure any subsequent attempts to do I/O fail cleanly */
150+
MyProcPort->sock=-1;
151+
}
148152
}
149153

150154

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp