changeset 208:1a52846ec11f

* fix off-by-one closing open FDs
author Matt Johnston <matt@ucc.asn.au>
date Thu, 02 Jun 2005 22:53:18 +0000
parents 85cc531f711e
children 5a75f8a21503 ea9277442ef2
files svr-chansession.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/svr-chansession.c	Thu Jun 02 16:21:58 2005 +0000
+++ b/svr-chansession.c	Thu Jun 02 22:53:18 2005 +0000
@@ -837,7 +837,7 @@
 
 	/* close file descriptors except stdin/stdout/stderr
 	 * Need to be sure FDs are closed here to avoid reading files as root */
-	for (i = 3; i < (unsigned int)ses.maxfd; i++) {
+	for (i = 3; i <= (unsigned int)ses.maxfd; i++) {
 		if (m_close(i) == DROPBEAR_FAILURE) {
 			dropbear_exit("Error closing file desc");
 		}