From 0b5984d31e65cdc461bcae69276cde68b94d33e0 Mon Sep 17 00:00:00 2001 From: Zefram Date: Wed, 20 Dec 2017 04:29:29 +0000 Subject: set FD_CLOEXEC on PL_perlio_debug_fd There's clearly no intent for this to be inherited across exec. --- perlio.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'perlio.c') diff --git a/perlio.c b/perlio.c index d9fdac3f90..fa9f54feda 100644 --- a/perlio.c +++ b/perlio.c @@ -355,14 +355,14 @@ PerlIO_debug(const char *fmt, ...) PerlProc_getgid() == PerlProc_getegid()) { const char * const s = PerlEnv_getenv("PERLIO_DEBUG"); if (s && *s) - PL_perlio_debug_fd - = PerlLIO_open3(s, O_WRONLY | O_CREAT | O_APPEND, 0666); + PL_perlio_debug_fd = PerlLIO_open3_cloexec(s, + O_WRONLY | O_CREAT | O_APPEND, 0666); else - PL_perlio_debug_fd = PerlLIO_dup(2); /* stderr */ + PL_perlio_debug_fd = PerlLIO_dup_cloexec(2); /* stderr */ } else { /* tainting or set*id, so ignore the environment and send the debug output to stderr, like other -D switches. */ - PL_perlio_debug_fd = PerlLIO_dup(2); /* stderr */ + PL_perlio_debug_fd = PerlLIO_dup_cloexec(2); /* stderr */ } } if (PL_perlio_debug_fd > 0) { -- cgit v1.2.1