| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             [2001-07-19 16:20 UTC] jflemer@php.net
  [2001-07-26 21:38 UTC] sniper@php.net
  | 
    |||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 10:00:02 2025 UTC | 
In safe mode, when you chdir a specific directory, it does not test the UID of directory but the UID of the directory below. Let's say we do a chdir ("/home/benoit"); In safe mode, it will test the UID of /home against the one of the script so it fails. If we do a chdir ("/home/benoit/."); , PHP test the UID of /home/benoit/ against the UID of the script and succeed. But, logically, the two commands should succeed the same way. I think it's related to the code in "ext/standard/dir.c" around line 286 : > if (PG(safe_mode) && !php_checkuid((*arg)->value.str.val, NULL, CHECKUID_ALLOW_ONLY_DIR)) { and the way php_checkuid handle CHECKUID_ALLOW_ONLY_DIR.