|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-10-12 23:22 UTC] marcel at hjortronet dot se
Description: ------------ Consider this example web server: 'D:\wwwroot\myweb\' (published as http://www.myweb.com/) IF the web servers access (or actually the 'IUSR_<computername>' user which enables IIS anonymous web access) is restricted to 'D:\wwwroot\myweb\' directory (and its subdirectories) and is not allowed to access any other local directory, like for example 'D:\wwwroot\', the code below ('chdir("../")') won't function if it is put into 'D:\wwwroot\myweb\test\' (published as http://www.myweb.com/test/reproducecode.php). Otherwise, thanks for doing a wonderful job! //Marcel, Sweden Reproduce code: --------------- <? echo getcwd()."<br/>\n"; echo chdir("../")."<br/>\n"; echo getcwd()."<br/>\n"; ?> Expected result: ---------------- D:\wwwroot\myforum\test 1 D:\wwwroot\myforum Actual result: -------------- D:\wwwroot\myforum\test D:\wwwroot\myforum\test PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 23 00:00:02 2025 UTC |
more info on the apache test: Actual Apache result @ the web client when no permission, for the user running the apache service, allowed to "D:\TEMP\apache-php-test\wwwroot\" but to "D:\TEMP\apache-php-test\wwwroot\a\" (the actual VirtualHost directory being published) and running the script* from within "D:\TEMP\apache-php-test\wwwroot\a\sub\": "D:\TEMP\apache-php-test\wwwroot\a\sub Warning: chdir() [function.chdir]: No such file or directory (errno 2) in D:\TEMP\apache-php-test\wwwroot\a\sub\index.php on line 3 D:\TEMP\apache-php-test\wwwroot\a\sub" When allowing for access to "D:\TEMP\apache-php-test\wwwroot\" (outside the actual web) the result becomes: "D:\TEMP\apache-php-test\wwwroot\a\sub 1 D:\TEMP\apache-php-test\wwwroot\a" * Script: "<? echo getcwd()."<br/>\n"; echo chdir("../")."<br/>\n"; echo getcwd()."<br/>\n"; ?>" Sincerely // MarcelDoes it work if you do just chdir(".."); ??