summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-lang/php/files/5.0.5/php5.0.5-gd_safe_mode.patch')
-rw-r--r--dev-lang/php/files/5.0.5/php5.0.5-gd_safe_mode.patch20
1 files changed, 20 insertions, 0 deletions
diff --git a/dev-lang/php/files/5.0.5/php5.0.5-gd_safe_mode.patch b/dev-lang/php/files/5.0.5/php5.0.5-gd_safe_mode.patch
new file mode 100644
index 0000000..05bb354
--- /dev/null
+++ b/dev-lang/php/files/5.0.5/php5.0.5-gd_safe_mode.patch
@@ -0,0 +1,20 @@
+--- ext/gd/gd.c 2005/05/06 16:49:04 1.294.2.12
++++ ext/gd/gd.c 2005/10/06 20:42:56 1.294.2.13
+@@ -18,7 +18,7 @@
+ +----------------------------------------------------------------------+
+ */
+
+-/* $Id: gd.c,v 1.294.2.12 2005/05/06 16:49:04 tony2001 Exp $ */
++/* $Id: gd.c,v 1.294.2.13 2005/10/06 20:42:56 iliaa Exp $ */
+
+ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center,
+ Cold Spring Harbor Labs. */
+@@ -1726,7 +1726,7 @@ static void _php_image_output(INTERNAL_F
+ }
+
+ if ((argc == 2) || (argc > 2 && Z_STRLEN_PP(file))) {
+- if (!fn || fn == empty_string || php_check_open_basedir(fn TSRMLS_CC)) {
++ if (!fn || fn == empty_string || php_check_open_basedir(fn TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(fn, "rb+", CHECKUID_CHECK_FILE_AND_DIR))) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid filename '%s'", fn);
+ RETURN_FALSE;
+ }