mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-28 07:51:11 +02:00
my_popen: close filedescriptors before exec
Signed-off-by: Jacek Jendrzej <crashdvb@googlemail.com>
Origin commit data
------------------
Branch: ni/coolstream
Commit: 3064107b90
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2013-02-20 (Wed, 20 Feb 2013)
------------------
This commit was generated by Migit
This commit is contained in:
committed by
Jacek Jendrzej
parent
d37d693cc8
commit
19857a5521
@@ -129,6 +129,9 @@ FILE* my_popen( pid_t& pid, const char *cmdstring, const char *type)
|
|||||||
close(pfd[0]);
|
close(pfd[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
int maxfd = getdtablesize();
|
||||||
|
for(int i = 3; i < maxfd; i++)
|
||||||
|
close(i);
|
||||||
execl("/bin/sh", "sh", "-c", cmdstring, (char *)0);
|
execl("/bin/sh", "sh", "-c", cmdstring, (char *)0);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user