php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44340 Openbasedir and symlinks
Submitted: 2008-03-05 16:44 UTC Modified: 2008-03-06 08:22 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: nahuel dot angelinetti at revues dot org Assigned:
Status: Not a bug Package: Safe Mode/open_basedir
PHP Version: 5.2.5 OS: Debian etch
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: nahuel dot angelinetti at revues dot org
New email:
PHP Version: OS:

 

 [2008-03-05 16:44 UTC] nahuel dot angelinetti at revues dot org
Description:
------------
When we have an openbasedir like :
/www/something/mysite/

and subdirs like :
/www/something/mysite/yourstuff/another/

When my script is running in /www/something/mysite/ and I want to create a link in the "another" directory to a file in "mysite" (../../myfile.html)

Reproduce code:
---------------
execute in /www/something/mysite/
<?php

symlink("../../mytarget.html","yourstuff/another/mylink");

?>

my target is in :
/www/something/mysite/mytarget.html

and mylink is in :
www/something/mysite/yourstuff/another/mylink


Expected result:
----------------
Just to create links that source and destination ARE in the openbasedir !

Actual result:
--------------
It say I'm out of the openbasedir, but the link isn't.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-03-05 23:43 UTC] iliaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

The link itself is outside of the allowable dir, hence the error.
 [2008-03-06 08:22 UTC] nahuel dot angelinetti at revues dot org
No, the link IS in the open_basedir. The link created create this link :
/www/something/mysite/yourstuff/another/mylink => ../../mytarget.html

And not :
/www/something/mysite/mylink => ../../mytarget.html


And the problem is it works well without open_basedir(and no link is pointing outside the open_basedir).
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 17 05:01:34 2025 UTC