mirror of
https://github.com/clearml/dropbear
synced 2025-01-31 19:07:28 +00:00
* fix off-by-one closing open FDs
--HG-- extra : convert_revision : cb23685eb24523d372c07830faea3a96e7c37917
This commit is contained in:
parent
d92ca4d9d1
commit
975b94c5f2
@ -837,7 +837,7 @@ static void execchild(struct ChanSess *chansess) {
|
|||||||
|
|
||||||
/* close file descriptors except stdin/stdout/stderr
|
/* close file descriptors except stdin/stdout/stderr
|
||||||
* Need to be sure FDs are closed here to avoid reading files as root */
|
* 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) {
|
if (m_close(i) == DROPBEAR_FAILURE) {
|
||||||
dropbear_exit("Error closing file desc");
|
dropbear_exit("Error closing file desc");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user