Enable chroot() only if SAPI is CGI.

This commit is contained in:
foobar 2001-09-12 02:07:46 +00:00
parent 8d88df3437
commit 5275b60398
4 changed files with 7 additions and 3 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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 */

View File

@ -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);