mirror of
https://github.com/php/php-src.git
synced 2025-01-26 21:54:16 +08:00
Enable chroot() only if SAPI is CGI.
This commit is contained in:
parent
8d88df3437
commit
5275b60398
@ -653,7 +653,7 @@ function_entry basic_functions[] = {
|
||||
PHP_FE(closedir, NULL)
|
||||
PHP_FE(chdir, NULL)
|
||||
|
||||
#if defined(HAVE_CHROOT) && !defined(ZTS)
|
||||
#if defined(HAVE_CHROOT) && !defined(ZTS) && ENABLE_CHROOT_FUNC
|
||||
PHP_FE(chroot, NULL)
|
||||
#else
|
||||
PHP_FALIAS(chroot, warn_not_available, NULL)
|
||||
|
@ -229,4 +229,8 @@ AC_ARG_WITH(system-regex,
|
||||
fi
|
||||
])
|
||||
|
||||
if test "$PHP_SAPI" = "cgi"; then
|
||||
AC_DEFINE(ENABLE_CHROOT_FUNC, 1, [Whether to enable chroot() function])
|
||||
fi
|
||||
|
||||
PHP_EXTENSION(standard)
|
||||
|
@ -221,7 +221,7 @@ PHP_FUNCTION(closedir)
|
||||
|
||||
/* }}} */
|
||||
|
||||
#if defined(HAVE_CHROOT) && !defined(ZTS)
|
||||
#if defined(HAVE_CHROOT) && !defined(ZTS) && ENABLE_CHROOT_FUNC
|
||||
/* {{{ proto int chroot(string directory)
|
||||
Change root directory */
|
||||
|
||||
|
@ -28,7 +28,7 @@ PHP_RINIT_FUNCTION(dir);
|
||||
PHP_FUNCTION(opendir);
|
||||
PHP_FUNCTION(closedir);
|
||||
PHP_FUNCTION(chdir);
|
||||
#if defined(HAVE_CHROOT) && !defined(ZTS)
|
||||
#if defined(HAVE_CHROOT) && !defined(ZTS) && ENABLE_CHROOT_FUNC
|
||||
PHP_FUNCTION(chroot);
|
||||
#endif
|
||||
PHP_FUNCTION(getcwd);
|
||||
|
Loading…
Reference in New Issue
Block a user