summaryrefslogtreecommitdiff
path: root/sapi/apache
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>2000-10-11 16:24:35 +0000
committerZeev Suraski <zeev@php.net>2000-10-11 16:24:35 +0000
commit1abd99a44397cd145151b8ad68a9cb03b203e55d (patch)
treea1ebf5219603dcd9c03a70df4450d15ab83ceadd /sapi/apache
parent9aa38aad4585a55de941c68aa22b5163ba9cba8e (diff)
downloadphp-git-1abd99a44397cd145151b8ad68a9cb03b203e55d.tar.gz
Fixed a problem that allowed users to override admin_value's and admin_flag's
Diffstat (limited to 'sapi/apache')
-rw-r--r--sapi/apache/mod_php4.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/sapi/apache/mod_php4.c b/sapi/apache/mod_php4.c
index a0e6610466..ccce6b4ff9 100644
--- a/sapi/apache/mod_php4.c
+++ b/sapi/apache/mod_php4.c
@@ -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;
}