]> granicus.if.org Git - php/commitdiff
There might be more systems which do not support chroot, so we check
authorSascha Schumann <sas@php.net>
Thu, 15 Feb 2001 05:21:27 +0000 (05:21 +0000)
committerSascha Schumann <sas@php.net>
Thu, 15 Feb 2001 05:21:27 +0000 (05:21 +0000)
for the existence of it.

Additionally, if chroot is not supported, the warn_not_available function
is invoked now.

configure.in
ext/standard/basic_functions.c
ext/standard/dir.c
ext/standard/php_dir.h

index b8012d0d2e36db9a9f991c16d71539500a219d91..3588023ccd6d1a20c2f476525d0e0799f4923868 100644 (file)
@@ -358,6 +358,7 @@ dnl Checks for library functions.
 AC_FUNC_VPRINTF
 AC_CHECK_FUNCS(
 asctime_r \
+chroot \
 crypt \
 ctime_r \
 cuserid \
index 303d3b46390cf40830aa60eb43f03bb4f8e23868..855457b815b0fb902dbc9443e988346ee4fd587a 100644 (file)
@@ -465,8 +465,10 @@ function_entry basic_functions[] = {
        PHP_FE(opendir,                         NULL)
        PHP_FE(closedir,                        NULL)
        PHP_FE(chdir,                           NULL)
-#if !defined(ZEND_WIN32)&&!defined(ZTS)
+#if defined(HAVE_CHROOT) && !defined(ZTS)
        PHP_FE(chroot,                          NULL)
+#else
+       PHP_FALIAS(chroot, warn_not_available, NULL)
 #endif
        PHP_FE(getcwd,                          NULL)
        PHP_FE(rewinddir,                       NULL)
index 39df84b267abb6ce499116eff6954dd89b88ce68..89f4f797c046af741e1f910efd5575036a2c35f7 100644 (file)
@@ -223,7 +223,7 @@ PHP_FUNCTION(closedir)
 
 /* }}} */
 
-#if !defined(ZEND_WIN32)&&!defined(ZTS)
+#if defined(HAVE_CHROOT) && !defined(ZTS)
 /* {{{ proto int chroot(string directory)
    Change root directory */
 
index 3326b94a0a92dfa22ea3654df7b6dec85da42369..7bef9249e775a8e865ef3e0303da4e247d0adb5b 100644 (file)
@@ -28,7 +28,7 @@ PHP_RINIT_FUNCTION(dir);
 PHP_FUNCTION(opendir);
 PHP_FUNCTION(closedir);
 PHP_FUNCTION(chdir);
-#if !defined(ZEND_WIN32)&&!defined(ZTS)
+#if defined(HAVE_CHROOT) && !defined(ZTS)
 PHP_FUNCTION(chroot);
 #endif
 PHP_FUNCTION(getcwd);