summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2005-06-02 22:53:18 +0000
committerMatt Johnston <matt@ucc.asn.au>2005-06-02 22:53:18 +0000
commit975b94c5f2f5bbb8aa455445ffb26092d01568e5 (patch)
tree1da6b6c8373d13ea4883a2719c1fdaa5d999ef70
parentd92ca4d9d11d3beb8268c5186f45f276dd26e354 (diff)
* fix off-by-one closing open FDs
--HG-- extra : convert_revision : cb23685eb24523d372c07830faea3a96e7c37917
-rw-r--r--svr-chansession.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/svr-chansession.c b/svr-chansession.c
index a040a47..1704c6e 100644
--- a/svr-chansession.c
+++ b/svr-chansession.c
@@ -837,7 +837,7 @@ static void execchild(struct ChanSess *chansess) {
/* 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");
}