Author: Russell Coker Description: Fixes file handle 3 to be left open when running programs (Closes: #166677). --- a/exp_clib.c +++ b/exp_clib.c @@ -2040,6 +2040,7 @@ /* save error fd while we're setting up new one */ errorfd = fcntl(2,F_DUPFD,3); + fcntl(3, F_SETFD, FD_CLOEXEC); /* and here is the macro to restore it */ #define restore_error_fd {close(2);fcntl(errorfd,F_DUPFD,2);} --- a/exp_command.c +++ b/exp_command.c @@ -1162,6 +1162,7 @@ /* save error fd while we're setting up new one */ errorfd = fcntl(2,F_DUPFD,3); + fcntl(3, F_SETFD, FD_CLOEXEC); /* and here is the macro to restore it */ #define restore_error_fd {close(2);fcntl(errorfd,F_DUPFD,2);}