> > On 3-Aug-07, at 9:51 AM, Uwe Schindler wrote:
> >
> > >> This's a special case and it's really great you noticed it in RC..
> > >> We need a workaround for this special case, as if we make all INI
> > >> directives set
> > >> using php_admin_value non-changeable, we break the @ thing.
> > >> So we either need to change the @ not to use zend_alter_ini_entry,
> > >> or make
> > >> an
> > >> exception in that function, which I believe would be a hack.
> > >
> > > Thats correct. An idea would be to make the @ operator only change
> > > EG(error_reporting) without changing the whole ini-entry by
> > > alter_ini_entry
> > > (which is a big slowdown...).
> >
> > The problem with that fix that a crash would potentially leave the
> > error blocking on, and INI clean up will not reset it.
> 
> The problem with the original fix of antony was the same: The first time
> any
> thread started to modify any INI entry it was marked as "admin"-only for
> the
> whole PHP server until a restart and it stayed in that state because the
> flag was changed *before* the hash table was replicated. This is a second
> bug. So at least the lines of antony must moved a few lines down in
> code...

I attached a patch. This patch must be applied in all cases. A second thing
is to remove breakage of the @ operator.

Uwe
Index: zend_ini.c
===================================================================
RCS file: /repository/ZendEngine2/zend_ini.c,v
retrieving revision 1.39.2.2.2.10
diff -u -r1.39.2.2.2.10 zend_ini.c
--- zend_ini.c  17 Jun 2007 14:31:12 -0000      1.39.2.2.2.10
+++ zend_ini.c  3 Aug 2007 14:46:30 -0000
@@ -243,10 +243,6 @@
                return FAILURE;
        }
 
-       if (stage == ZEND_INI_STAGE_ACTIVATE && modify_type == ZEND_INI_SYSTEM) 
{
-               ini_entry->modifiable = ZEND_INI_SYSTEM;
-       }
-
        if (!(ini_entry->modifiable & modify_type)) {
                return FAILURE;
        }
@@ -264,6 +260,10 @@
                zend_hash_add(EG(modified_ini_directives), name, name_length, 
&ini_entry, sizeof(zend_ini_entry*), NULL);
        }
 
+       if (stage == ZEND_INI_STAGE_ACTIVATE && modify_type == ZEND_INI_SYSTEM) 
{
+               ini_entry->modifiable = ZEND_INI_SYSTEM;
+       }
+
        duplicate = estrndup(new_value, new_value_length);
 
        if (!ini_entry->on_modify

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to