Skip to content

Commit 08dffa0

Browse files
Leontsteve-m-hay
authored andcommitted
Use PerlLIO_dup_cloexec in Perl_dirp_dup to set O_CLOEXEC
dup doesn't mark the new descriptor as close-on-exec, which can lead to a descriptor leaking to the new process. (cherry picked from commit d6f09a8)
1 parent b088e97 commit 08dffa0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14028,7 +14028,7 @@ Perl_dirp_dup(pTHX_ DIR *const dp, CLONE_PARAMS *const param)
1402814028

1402914029
PERL_UNUSED_ARG(param);
1403014030

14031-
ret = fdopendir(dup(my_dirfd(dp)));
14031+
ret = fdopendir(PerlLIO_dup_cloexec(my_dirfd(dp)));
1403214032

1403314033
#elif defined(WIN32)
1403414034
ret = win32_dirp_dup(dp, param);

0 commit comments

Comments
 (0)