Edit report at https://bugs.php.net/bug.php?id=62509&edit=1

 ID:                 62509
 Updated by:         johan...@php.net
 Reported by:        streaky at mkybrokenlogic dot com
 Summary:            chroot() is disabled with ZTS enabled
-Status:             Open
+Status:             Not a bug
 Type:               Feature/Change Request
 Package:            Directory function related
 Operating System:   Anything but windows?
 PHP Version:        Irrelevant
 Block user comment: N
 Private report:     N

 New Comment:

You shouldn't use ZTS binaries in non-threaded context. They need more memory, 
they are slower, they are harder to debug in case of critical errors.

That aside: We have no good mechanism to disable it easily in one context only.


Previous Comments:
------------------------------------------------------------------------
[2012-07-08 17:00:46] streaky at mkybrokenlogic dot com

Description:
------------
chroot() seems to be arbitrarily disabled with ZTS enabled. It seems like it is 
disabled because when ZTS is -usually- used it is with a sapi that requires 
thread safety but this isn't always the case.

AFAIK there isn't a good reason for it, I assume it's some sort of oversight - 
a cheap and cheerful way to achieve the above, but it doesn't account for all 
circumstances so you have to go hacking on the source code in about 3 different 
places.

It probably should be as is *except* for if CLI and possibly CGI is the SAPI.

Test script:
---------------
<?php

var_dump(chroot("/chroot/me/here/"));


Expected result:
----------------
bool(true)

Actual result:
--------------
Fatal error: Call to undefined function chroot()


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=62509&edit=1

Reply via email to