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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
3 + 31 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 22:01:27 2024 UTC