php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21095 symlink and chroot
Submitted: 2002-12-19 06:11 UTC Modified: 2002-12-29 14:32 UTC
From: busia at tiscali dot it Assigned:
Status: Wont fix Package: Filesystem function related
PHP Version: 4.3.0RC3 OS: Redhat 7.2
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2002-12-19 06:11 UTC] busia at tiscali dot it
if I use

<?
chdir("/home/foo_alfa");
symlinks("../foo", "bar");
?>

the symlink that is created in /home/foo_alfa is 
bar -> /home/foo

ant not
bar -> ../foo

how expected

this is a problem because I use chroot jails for ftp and the file became not accessible.

Andrea Busia

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-12-19 18:43 UTC] iliaa@php.net
Are you using PHP with thread safety enabled?
 [2002-12-20 06:10 UTC] busia at tiscali dot it
Yes I use php with thread safe enabled, I'm using Apache 2.0.43 with worker MPM.
 [2002-12-29 14:32 UTC] iliaa@php.net
Because in thread safe mode PHP does not actually change directories making a symlink on relative paths will often fail if any chdir() calls are found inside the script. Therefor when ZTS is used symlinks are always done on FULL paths.
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC