diff options
Diffstat (limited to 'Zend/zend_ini.c')
-rw-r--r-- | Zend/zend_ini.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/Zend/zend_ini.c b/Zend/zend_ini.c index 80db6f96d..13b8e38e3 100644 --- a/Zend/zend_ini.c +++ b/Zend/zend_ini.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_ini.c,v 1.39.2.2.2.25 2007/10/01 15:00:15 iliaa Exp $ */ +/* $Id: zend_ini.c,v 1.39.2.2.2.27 2008/03/13 15:56:21 iliaa Exp $ */ #include "zend.h" #include "zend_qsort.h" @@ -63,6 +63,9 @@ static int zend_restore_ini_entry_cb(zend_ini_entry *ini_entry, int stage TSRMLS ini_entry->modified = 0; ini_entry->orig_value = NULL; ini_entry->orig_value_length = 0; + if (ini_entry->modifiable >= (1 << 3)) { + ini_entry->modifiable >>= 3; + } } return 0; } @@ -244,6 +247,7 @@ ZEND_API int zend_alter_ini_entry_ex(char *name, uint name_length, char *new_val { zend_ini_entry *ini_entry; char *duplicate; + zend_bool modifiable; zend_bool modified; TSRMLS_FETCH(); @@ -251,8 +255,12 @@ ZEND_API int zend_alter_ini_entry_ex(char *name, uint name_length, char *new_val return FAILURE; } + modifiable = ini_entry->modifiable; + modified = ini_entry->modified; + if (stage == ZEND_INI_STAGE_ACTIVATE && modify_type == ZEND_INI_SYSTEM) { - ini_entry->modifiable = ZEND_INI_SYSTEM; + /* only touch lower bits */ + ini_entry->modifiable = (ini_entry->modifiable & (ZEND_INI_ALL << 3)) | ZEND_INI_SYSTEM; } if (!force_change) { @@ -261,8 +269,6 @@ ZEND_API int zend_alter_ini_entry_ex(char *name, uint name_length, char *new_val } } - modified = ini_entry->modified; - if (!EG(modified_ini_directives)) { ALLOC_HASHTABLE(EG(modified_ini_directives)); zend_hash_init(EG(modified_ini_directives), 8, NULL, NULL, 0); @@ -270,6 +276,8 @@ ZEND_API int zend_alter_ini_entry_ex(char *name, uint name_length, char *new_val if (!modified) { ini_entry->orig_value = ini_entry->value; ini_entry->orig_value_length = ini_entry->value_length; + /* store orginial value in the upper bits */ + ini_entry->modifiable = (modifiable << 3) | ini_entry->modifiable; ini_entry->modified = 1; zend_hash_add(EG(modified_ini_directives), name, name_length, &ini_entry, sizeof(zend_ini_entry*), NULL); } |