php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #18285 php_checkuid modifies passed filenames/paths
Submitted: 2002-07-11 17:09 UTC Modified: 2002-07-12 20:52 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: ilia at prohost dot org Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.3.0-dev OS: Linux 2.4.17
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ilia at prohost dot org
New email:
PHP Version: OS:

 

 [2002-07-11 17:09 UTC] ilia at prohost dot org
While trying to make a directory on a system with safe_mode enabled and LANG enviroemnt variable fi_FI@euro I came across the problem that is best demonstrated by the script below:
<?php
$src = '/dir/another/dir2/src';
if( !is_dir($src) ) {
      echo "no dir $src<br>n";
      if( !@mkdir($src, 0755) ) {
          echo "cannot make dir: $src<Br>n";
      }
}
?>
On the 2nd echo $src string is corrupted, the last / is replaced with a special character, which Mozilla displayes as a square.

If mkdir($src, 0755) is replaced with mkdir($src.'', 0755) the memory corruption goes away.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-07-11 21:15 UTC] sniper@php.net
The php_checkuid() function in ext/safe_mode.c is fubar.
It modifies the passed filename/path. Also, it's not 
possible to pass paths with trailing slash when safe-mode is 
enabled.


 [2002-07-12 20:52 UTC] sniper@php.net
This bug has been fixed in CVS. You can grab a snapshot of the
CVS version at http://snaps.php.net/. In case this was a documentation 
problem, the fix will show up soon at http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites.
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Oct 07 17:00:02 2026 UTC