PHP 4.0 Bug #5447: Apache Seg. Fault while using posix_getpwuid()
| From: | jasonc at webpipe dot net | Date: | Fri, 07 Jul 2000 22:51:48 +0000 |
| Subject: | PHP 4.0 Bug #5447: Apache Seg. Fault while using posix_getpwuid() | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-23751@lists.php.net to get a copy of this message | ||
From: jasonc@webpipe.net
Operating system: Redhat 6.2
PHP version: 4.0.0
PHP Bug Type: Reproduceable crash
Bug description: Apache Seg. Fault while using posix_getpwuid()
The following causes an Apache Seg Fault:
<?
$dir = "/var/tmp";
exec("ls $dir",$dir_content,$returnVal);
if($returnVal == 1)
{
echo"Unable to process request.<br>";
}
?>
<html>
<body>
<?
for($i =0; $i < count($dir_content); $i++)
{
$file = $dir."/".$dir_content[$i];
echo $file." -- ";
$owner_info = posix_getpwuid(fileowner($file));
echo $owner_info["name"]."<br>\n";
}
?>
</body>
</html>
PHP Configuration:
'./configure' '--with-apache=../apache_1.3.12'
'--with-config-file-path=/usr/local/apache/conf/' '--enable-track-vars'
'--enable-magic-quotes' '--with-cybercash=/usr/local/cybercash/'
'--with-gd=/usr/local/gd-1.8.3/' '--with-jpeg-dir=/usr/local/gd-1.8.3/'
'--with-ttf=/usr/local/gd-1.8.3/' '--with-imap=/usr/local/imap/'
'--with-mysql=/usr/local/mysql/' '--with-pdflib=/usr/local/lib/'
'--with-pgsql=/usr/local/pgsql/' '--disable-debug'
If you need a copy of php.ini, let me know.
If I hardcode a file within the loop like "/tmp/test.txt" it works fine. It has problems
when it steps through the array. However, if you comment out the line with the posix_getpwuid()
function, everything works fine.
Jason