]> granicus.if.org Git - php/commitdiff
Fixed a problem that allowed users to override admin_value's and admin_flag's
authorZeev Suraski <zeev@php.net>
Wed, 11 Oct 2000 16:24:35 +0000 (16:24 +0000)
committerZeev Suraski <zeev@php.net>
Wed, 11 Oct 2000 16:24:35 +0000 (16:24 +0000)
NEWS
sapi/apache/mod_php4.c

diff --git a/NEWS b/NEWS
index efd4f6cf0c0c1d41a179e6c9328211f1e738bf88..b711b5715bdb4f5a11f77b240b407671ac12b0a3 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,8 @@ PHP 4.0                                                                    NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 
 05 Oct 2000, Version 4.0.3
+- Fixed a problem that allowed users to override admin_value's and admin_flag's
+  (Zeev)
 - Fixed PostgreSQL module to work when the link handle is omitted (Zeev)
 - Fixed returning of empty LOB fields in OCI8. (Thies)
 - Added Calendar module to default Win32 build (Andi)
index a0e66104664e3c0dd58828c5f09efc5717dfdada..ccce6b4ff909b2667182c3f376c4fce11a310f10 100644 (file)
@@ -548,12 +548,24 @@ static void copy_per_dir_entry(php_per_dir_entry *per_dir_entry)
 }
 
 
+static zend_bool should_overwrite_per_dir_entry(php_per_dir_entry *orig_per_dir_entry, php_per_dir_entry *new_per_dir_entry)
+{
+       if (orig_per_dir_entry->type==PHP_INI_SYSTEM
+               && new_per_dir_entry->type!=PHP_INI_SYSTEM) {
+               return 0;
+       } else {
+               return 1;
+       }
+}
+
+
 static void php_destroy_per_dir_info(HashTable *per_dir_info)
 {
        zend_hash_destroy(per_dir_info);
        free(per_dir_info);
 }
 
+
 static void *php_create_dir(pool *p, char *dummy)
 {
        HashTable *per_dir_info;
@@ -570,8 +582,9 @@ static void *php_merge_dir(pool *p, void *basev, void *addv)
 {
        php_per_dir_entry tmp;
 
-       zend_hash_merge((HashTable *) addv, (HashTable *) basev, (void (*)(void *)) copy_per_dir_entry, &tmp, sizeof(php_per_dir_entry), 0);
-       return addv;
+       zend_hash_merge_ex((HashTable *) basev, (HashTable *) addv, (copy_ctor_func_t) copy_per_dir_entry, sizeof(php_per_dir_entry), (zend_bool (*)(void *, void *)) should_overwrite_per_dir_entry);
+       /*zend_hash_merge((HashTable *) addv, (HashTable *) basev, (void (*)(void *)) copy_per_dir_entry, &tmp, sizeof(php_per_dir_entry), 0);*/
+       return basev;
 }