* fix off-by-one closing open FDs

--HG--
extra : convert_revision : cb23685eb24523d372c07830faea3a96e7c37917
This commit is contained in:
Matt Johnston 2005-06-02 22:53:18 +00:00
parent d92ca4d9d1
commit 975b94c5f2

View File

@ -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");
}