cvs: php4 /ext/standard basic_functions.c url_scanner_ex.c
| From: | Rasmus Lerdorf | Date: | Sat, 11 May 2002 18:35:59 +0000 |
| Subject: | cvs: php4 /ext/standard basic_functions.c url_scanner_ex.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-11845@lists.php.net to get a copy of this message | ||
rasmus Sat May 11 14:35:59 2002 EDT
Modified files:
/php4/ext/standard basic_functions.c url_scanner_ex.c
Log:
show_source() safe-mode fix
@ show_source() was evading safe-mode - fixed (Rasmus)
Index: php4/ext/standard/basic_functions.c
diff -u php4/ext/standard/basic_functions.c:1.476 php4/ext/standard/basic_functions.c:1.477
--- php4/ext/standard/basic_functions.c:1.476 Sat May 4 14:33:13 2002
+++ php4/ext/standard/basic_functions.c Sat May 11 14:35:59 2002
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: basic_functions.c,v 1.476 2002/05/04 18:33:13 sas Exp $ */
+/* $Id: basic_functions.c,v 1.477 2002/05/11 18:35:59 rasmus Exp $ */
#include "php.h"
#include "php_streams.h"
@@ -1865,6 +1865,14 @@
return;
}
convert_to_string(filename);
+
+ if (PG(safe_mode) && (!php_checkuid(Z_STRVAL_P(filename), NULL,
CHECKUID_ALLOW_ONLY_FILE))) {
+ RETURN_FALSE;
+ }
+
+ if (php_check_open_basedir(Z_STRVAL_P(filename) TSRMLS_CC)) {
+ RETURN_FALSE;
+ }
if (i) {
php_start_ob_buffer (NULL, 0, 1 TSRMLS_CC);
Index: php4/ext/standard/url_scanner_ex.c
diff -u php4/ext/standard/url_scanner_ex.c:1.65 php4/ext/standard/url_scanner_ex.c:1.66
--- php4/ext/standard/url_scanner_ex.c:1.65 Sun May 5 12:40:20 2002
+++ php4/ext/standard/url_scanner_ex.c Sat May 11 14:35:59 2002
@@ -1,5 +1,5 @@
-/* Generated by re2c 0.5 on Sun May 5 18:40:01 2002 */
-#line 1 "/home/thies/devel/php4/ext/standard/url_scanner_ex.re"
+/* Generated by re2c 0.5 on Wed May 8 08:08:09 2002 */
+#line 1 "/home/rasmus/php4/ext/standard/url_scanner_ex.re"
/*
+----------------------------------------------------------------------+
| PHP Version 4 |