php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6908 rmdir fails after using dir()
Submitted: 2000-09-27 19:33 UTC Modified: 2001-02-20 07:53 UTC
From: rene dot mueller at datura dot ch Assigned:
Status: Closed Package: Directory function related
PHP Version: 4.0.2 OS: NT 4.0
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: rene dot mueller at datura dot ch
New email:
PHP Version: OS:

 

 [2000-09-27 19:33 UTC] rene dot mueller at datura dot ch
the following sequence fails at rmdir() with permission denied as long as we uncomment the $d-part. 

Wa are not very shure if it's a problem of the code somehow or a bug.

Thanks for any answers.

/*
  $d = dir( "./temp/sess_".session_id() );
  while( $entry = $d->read() )
  {
    if ( $entry != "" && $entry != "." && $entry != ".." )
    {
      $fn = $d->path."/".$entry;
      unlink( $fn );
    }
  }
  $d->close();

  echo "all files deleted <br>";
*/

  $canonical_dir = str_replace( "\\", "/", $PATH_TRANSLATED );
  $canonical_dir = substr( $canonical_dir, 0, strrpos( $canonical_dir, "/" ) );
  $canonical_dir = $canonical_dir."/temp/sess_".session_id();

  echo "dirname : " . $canonical_dir . "<br>";

  rmdir( $canonical_dir );

  echo "directory removed <br>";

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-11-20 12:36 UTC] sniper@php.net
reclassify

 [2001-01-18 21:24 UTC] sniper@php.net
Does this happen with PHP 4.0.4pl1 ?

--Jani
 [2001-02-20 07:53 UTC] sniper@php.net
No feedback, considered fixed.

--Jani

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jan 15 09:01:28 2025 UTC