]> granicus.if.org Git - php/commitdiff
Enable chroot() only if SAPI is CGI.
authorfoobar <sniper@php.net>
Wed, 12 Sep 2001 02:07:46 +0000 (02:07 +0000)
committerfoobar <sniper@php.net>
Wed, 12 Sep 2001 02:07:46 +0000 (02:07 +0000)
ext/standard/basic_functions.c
ext/standard/config.m4
ext/standard/dir.c
ext/standard/php_dir.h

index 7d10d5c044cd4002680be7666813c993026d381b..f401bd192a23b8234eabe37f2655bddda303c55d 100644 (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)
index cdfa5269dc3cda748787d8f7015a42a32d075968..e0043d23a78d41f1f2c48bff5980918c488d7abd 100644 (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)
index b0022e28e52c79e9e344194d727d097de1332456..186318a6bf488e11b31c9ffc8caef08d6c9c5c51 100644 (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 */
 
index 186a7cdc89065676b19cd6c0b5c6d0ef61983604..3b648c62df59dea3619ee289d79fb59637b719d9 100644 (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);