Re: chroot function availability disqualifiers
| From: | Johannes Schlüter | Date: | Sat, 06 Nov 2010 21:27:39 +0000 |
| Subject: | Re: chroot function availability disqualifiers | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-50115@lists.php.net to get a copy of this message | ||
Hi,
On Sat, 2010-11-06 at 13:37 -0700, Justin Martin wrote:
> So far as I can tell, from ext/standard/dir.c, chroot is only compiled
> in #if defined(HAVE_CHROOT) && !defined(ZTS) && ENABLE_CHROOT_FUNC
The relevant checks are in ext/standard/config.m4:
if test "$PHP_SAPI" = "cgi" || test "$PHP_SAPI" =
"cli" || test "$PHP_SAPI" = "embed"; then
AC_DEFINE(ENABLE_CHROOT_FUNC, 1, [Whether to enable chroot() function])
fi
and configure.in:
AC_CHECK_FUNCS(
...
chroot \
...
)
The first test checks the sapi as we don't want to allow chroot() from
withina server module, like chroot()ing an apache child etc.
The later check sets HAVE_CHROOT if it can be found on the host OS. I
assume any used "Unix" system has chroot() in it's libc library.
johannes