diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index 56b29b6c6..c61f7e3c1 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -129,6 +129,9 @@ FILE* my_popen( pid_t& pid, const char *cmdstring, const char *type) close(pfd[0]); } } + int maxfd = getdtablesize(); + for(int i = 3; i < maxfd; i++) + close(i); execl("/bin/sh", "sh", "-c", cmdstring, (char *)0); exit(0); }