cvs: php4 /ext/standard basic_functions.c config.m4 dir.c php_dir.h
| From: | Jani Taskinen | Date: | Wed, 12 Sep 2001 02:07:47 +0000 |
| Subject: | cvs: php4 /ext/standard basic_functions.c config.m4 dir.c php_dir.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-7410@lists.php.net to get a copy of this message | ||
sniper Tue Sep 11 22:07:47 2001 EDT
Modified files:
/php4/ext/standard basic_functions.c config.m4 dir.c php_dir.h
Log:
Enable chroot() only if SAPI is CGI.
Index: php4/ext/standard/basic_functions.c
diff -u php4/ext/standard/basic_functions.c:1.395 php4/ext/standard/basic_functions.c:1.396
--- php4/ext/standard/basic_functions.c:1.395 Sun Sep 9 09:29:14 2001
+++ php4/ext/standard/basic_functions.c Tue Sep 11 22:07:46 2001
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: basic_functions.c,v 1.395 2001/09/09 13:29:14 derick Exp $ */
+/* $Id: basic_functions.c,v 1.396 2001/09/12 02:07:46 sniper Exp $ */
#include "php.h"
#include "php_main.h"
@@ -653,7 +653,7 @@
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: php4/ext/standard/config.m4
diff -u php4/ext/standard/config.m4:1.30 php4/ext/standard/config.m4:1.31
--- php4/ext/standard/config.m4:1.30 Thu Jun 7 08:18:02 2001
+++ php4/ext/standard/config.m4 Tue Sep 11 22:07:46 2001
@@ -1,4 +1,4 @@
-dnl $Id: config.m4,v 1.30 2001/06/07 12:18:02 rasmus Exp $ -*- sh -*-
+dnl $Id: config.m4,v 1.31 2001/09/12 02:07:46 sniper Exp $ -*- sh -*-
divert(3)dnl
@@ -228,5 +228,9 @@
REGEX_TYPE=php
fi
])
+
+if test "$PHP_SAPI" = "cgi"; then
+ AC_DEFINE(ENABLE_CHROOT_FUNC, 1, [Whether to enable chroot() function])
+fi
PHP_EXTENSION(standard)
Index: php4/ext/standard/dir.c
diff -u php4/ext/standard/dir.c:1.78 php4/ext/standard/dir.c:1.79
--- php4/ext/standard/dir.c:1.78 Sun Sep 9 09:29:16 2001
+++ php4/ext/standard/dir.c Tue Sep 11 22:07:46 2001
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dir.c,v 1.78 2001/09/09 13:29:16 derick Exp $ */
+/* $Id: dir.c,v 1.79 2001/09/12 02:07:46 sniper Exp $ */
/* {{{ includes/startup/misc */
@@ -221,7 +221,7 @@
/* }}} */
-#if defined(HAVE_CHROOT) && !defined(ZTS)
+#if defined(HAVE_CHROOT) && !defined(ZTS) && ENABLE_CHROOT_FUNC
/* {{{ proto int chroot(string directory)
Change root directory */
Index: php4/ext/standard/php_dir.h
diff -u php4/ext/standard/php_dir.h:1.15 php4/ext/standard/php_dir.h:1.16
--- php4/ext/standard/php_dir.h:1.15 Mon Feb 26 01:07:23 2001
+++ php4/ext/standard/php_dir.h Tue Sep 11 22:07:46 2001
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_dir.h,v 1.15 2001/02/26 06:07:23 andi Exp $ */
+/* $Id: php_dir.h,v 1.16 2001/09/12 02:07:46 sniper Exp $ */
#ifndef PHP_DIR_H
#define PHP_DIR_H
@@ -28,7 +28,7 @@
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);