From 876045b0fb273ee11b02c535833b076c875253dc Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Fri, 8 Jan 2010 17:08:00 +1100 Subject: - markus@cvs.openbsd.org 2009/11/11 21:37:03 [channels.c channels.h] fix race condition in x11/agent channel allocation: don't read after the end of the select read/write fdset and make sure a reused FD is not touched before the pre-handlers are called. with and ok djm@ --- channels.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'channels.h') diff --git a/channels.h b/channels.h index b0f5dc32..4dbeeb6e 100644 --- a/channels.h +++ b/channels.h @@ -1,4 +1,4 @@ -/* $OpenBSD: channels.h,v 1.99 2009/10/28 16:38:18 reyk Exp $ */ +/* $OpenBSD: channels.h,v 1.100 2009/11/11 21:37:03 markus Exp $ */ /* * Author: Tatu Ylonen @@ -97,7 +97,11 @@ struct Channel { int wfd_isatty; /* wfd is a tty */ int client_tty; /* (client) TTY has been requested */ int force_drain; /* force close on iEOF */ - int delayed; /* fdset hack */ + int delayed; /* post-select handlers for newly created + * channels are delayed until the first call + * to a matching pre-select handler. + * this way post-select handlers are not + * accidenly called if a FD gets reused */ Buffer input; /* data read from socket, to be sent over * encrypted connection */ Buffer output; /* data received over encrypted connection for -- cgit v1.2.3