mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-04-20 01:26:38 +02:00
24 lines
725 B
Diff
24 lines
725 B
Diff
Author: Russell Coker <russell@coker.com.au>
|
|
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);}
|
|
|