On Tue, 12 Aug 2003 04:30:07 PDT, Jarkko Hietaniemi wrote:
>Change 20643 by [EMAIL PROTECTED] on 2003/08/12 10:13:53
>
> A generally useful hunk from Ilya's microperl patch.
> (If no fcntl F_SETFD, fake it the best we can.)
This doesn't look correct. pp[1] is closed, but the stale
fd is passed into the do_*exec*() calls below. If the exec()
fails, those functions will scribble into someone else's fd.
Why not avoid the creation of the error pipe for the crippled
platforms in the first place? Closing both ends of a pipe
pretty much means you never needed it to begin with. :) --GSAR
>Affected files ...
>
>... //depot/perl/pp_sys.c#348 edit
>
>Differences ...
>
>==== //depot/perl/pp_sys.c#348 (text) ====
>Index: perl/pp_sys.c
>--- perl/pp_sys.c#347~20630~ Tue Aug 12 00:59:22 2003
>+++ perl/pp_sys.c Tue Aug 12 03:13:53 2003
>@@ -4138,6 +4138,8 @@
> PerlLIO_close(pp[0]);
> #if defined(HAS_FCNTL) && defined(F_SETFD)
> fcntl(pp[1], F_SETFD, FD_CLOEXEC);
>+#else
>+ PerlLIO_close(pp[1]); /* Do as best as we can: pretend success. */
> #endif
> }
> if (PL_op->op_flags & OPf_STACKED) {
>End of Patch.