Re: exec in CLI vs. mod_php
| From: | Wez Furlong | Date: | Fri, 30 May 2003 15:18:18 +0000 |
| Subject: | Re: exec in CLI vs. mod_php | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-2096@lists.php.net to get a copy of this message | ||
For exec() and system(), we don't send any input and only capture
stdout. So, everything except the stdout fileno can be closed-on-exec.
The user can do the usual 2>&1 trick to get the stderr output as we run
their command using the shell.
--Wez.
On Fri, 30 May 2003, Zeev Suraski wrote:
> At 18:02 30/05/2003, Wez Furlong wrote:
> >I *think* that in the case of Brian's question (which applies to the
> >exec(), system() and so on family of PHP functions), we can safely loop
> >throught the descriptors (except for those we will be using to capture
> >or pass-thru the output) and set the close-on-exec flag prior to
> >forking.
>
> Yep, but how do you know which ones are the ones you shouldn't touch?
>
> Zeev
>
>
>