php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42102 Cannot access/unlink Symlinks if target does not exists
Submitted: 2007-07-25 13:13 UTC Modified: 2007-08-19 01:00 UTC
From: tom at ideaweb dot de Assigned:
Status: No Feedback Package: Safe Mode/open_basedir
PHP Version: 5.2.3 OS: Linux Debian 4.0 Etch
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: tom at ideaweb dot de
New email:
PHP Version: OS:

 

 [2007-07-25 13:13 UTC] tom at ideaweb dot de
Description:
------------
If i have a symlink with a deleted target in the same directory (like 
vmware.pdf -> 118536740980919500.file), i cannot access the symlink 
anymore and get an error that open_basedir restriction in effect.

I followed the instruction of closed bug #41847. i downloaded the 
latest php snapshot, but it doesnt help, same issue and now i get new 
strange thing (but only with >5.2.3):

Warning: session_start() [function.session-start]: open_basedir 
restriction in effect. File(/www/tmp) is not within the allowed path
(s): (/var/www/ideaweb.de/) in /var/www/ideaweb.de/ideacms/admin/
cms_log.php on line 1

/www/tmp is the session.save_path in php.ini

Is it a good idea, that i have to put the session files in the webroot 
with upcoming php versions (>5.2.3)? It means more overhead to 
protocet files from public if basedir is webroot.

Reproduce code:
---------------
<?php
	echo realpath( '.' );
	if( file_exists( "../media/db/test.pdf" ) ) {
     	unlink( "../media/db/test.pdf" );
    }
?>

Expected result:
----------------
/var/www/ideaweb.de/ideacms/admin

Actual result:
--------------
/var/www/ideaweb.de/ideacms/admin
Warning: file_exists() [function.file-exists]: open_basedir restriction 
in effect. File(../media/db/test.pdf) is not within the allowed path(s): 
(/var/www/ideaweb.de/) in /var/www/ideaweb.de/ideacms/admin/
mdb_editor.php on line 697

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-08-19 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 14:01:28 2024 UTC