From:             [EMAIL PROTECTED]
Operating system: Debian Linux
PHP version:      4.1.0
PHP Bug Type:     Feature/Change Request
Bug description:  readdir() not affected by safe_mode

I hope this is not just a configuration problem. We have safe_mode turned
on and all file-system functions ARE limited by safe_mode - only readdir()
doesn't seem to be. Would anyone mind to have a look at this? I have
provided a sample script so it shouldn't take long to test it with your
configuration:

----------------------------------
<?php

function list_dir($dir) {
  $h = @opendir($dir);

  if(!$h)
    return false;

  while($e = readdir($h)) {
    $p = $dir . '/' . $e;

    if($p != '.' && $p != '..')
      if(is_dir($p))
        echo '[DIR] ', $e, "<br>\n";
      else
        echo $e, "<br>\n";
  }

  closedir($h);
}

list_dir($QUERY_STRING);

?>
----------------------------------

just save this file as for example "dir.php" and run with

dir.php?/home/customer/

to list contents. I looked at the release announcement of 4.1.1 and there
was no description of this bug:

  http://www.php.net/release_4_1_1.php

I also looked through the existing bug database and found nothing about
it. Excuse me if it's a dupe or even a bogus.

Kind Regards,
  Daniel Lorch
  http://daniel.lorch.cc/
-- 
Edit bug report at: http://bugs.php.net/?id=15018&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to