PHP 4.0 Bug #3285 Updated: Cannot feed command stdin and get output, etc.
| From: | jimw@php.net | Date: | Sat, 10 Feb 2001 19:00:51 +0000 |
| Subject: | PHP 4.0 Bug #3285 Updated: Cannot feed command stdin and get output, etc. | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-46223@lists.php.net to get a copy of this message | ||
ID: 3285
Updated by: jimw
Reported By: kop@meme.com
Status: Open
Bug Type: Feature/Change Request
Assigned To:
Comments:
refiled against 4.0.
Previous Comments:
---------------------------------------------------------------------------
[2000-01-22 17:29:32] kop@meme.com
There is no way to execute a command, feed it stuff on standard in, retrive the return code,
standard out, and standard error. exec() should probably have two additional arguments, an array
for the output sent to standard error, and a string to be passed to to the child on standard in.
I could always pass arguments to commands, instead of having them read from standard in. However,
this is not a good idea from a security standpoint as argument values are visible to anybody on the
system.
In my particular case, I've got a specialized, suid root, password change program I'd like
to invoke from php. This program takes a password on standard in. If I don't give up and use
perl, I'll probably use popen() and output redirection to guarenteed unique file names in /tmp
to capture stdout and stderr, along with an echo of $? to get the return code. In my case this will
probably work. In the general case writing to the file system could be a security problem.
Certainlly it's a big hassle.
---------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=3285&edit=2