From 637e8e14aa81e9e8d3c76cc501bc044efea2e5ac Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Thu, 15 Feb 2001 05:21:27 +0000 Subject: [PATCH] There might be more systems which do not support chroot, so we check for the existence of it. Additionally, if chroot is not supported, the warn_not_available function is invoked now. --- configure.in | 1 + ext/standard/basic_functions.c | 4 +++- ext/standard/dir.c | 2 +- ext/standard/php_dir.h | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index b8012d0d2e..3588023ccd 100644 --- a/configure.in +++ b/configure.in @@ -358,6 +358,7 @@ dnl Checks for library functions. AC_FUNC_VPRINTF AC_CHECK_FUNCS( asctime_r \ +chroot \ crypt \ ctime_r \ cuserid \ diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 303d3b4639..855457b815 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -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) diff --git a/ext/standard/dir.c b/ext/standard/dir.c index 39df84b267..89f4f797c0 100644 --- a/ext/standard/dir.c +++ b/ext/standard/dir.c @@ -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 */ diff --git a/ext/standard/php_dir.h b/ext/standard/php_dir.h index 3326b94a0a..7bef9249e7 100644 --- a/ext/standard/php_dir.h +++ b/ext/standard/php_dir.h @@ -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); -- 2.50.1