ID:               28878
 Updated by:       [EMAIL PROTECTED]
 Reported By:      michaelw at webcentral dot com dot au
-Status:           Feedback
+Status:           Closed
 Bug Type:         iPlanet related
 Operating System: Solaris 9
 PHP Version:      4.3.7
-Assigned To:      
+Assigned To:      ThetaPhi
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip

The logic here is incorrect, could be better to change code to yours or
the following -- sorry:
ok&=(strcasecmp(entry->param->name,nsapi_exclude_from_ini_entries[j])!=0);

What should be checked:
there is a list of values that should not be ini-values because they
are normal parameters of the php4_execute function ("script",
"type",...). This for loop goes through the list of this entries, if
one of the entries is entry->param->name (strcasecmp==0) then this
should turn to "FALSE".

Ilia: Your thing works, but will not do what is wanted.


Previous Comments:
------------------------------------------------------------------------

[2004-06-22 16:24:05] [EMAIL PROTECTED]

Does it work if you change  
ok&=(!strcasecmp(entry->param->name,nsapi_exclude_from_ini_entries[j]));

to 
ok=(!strcasecmp(entry->param->name,nsapi_exclude_from_ini_entries[j]));


------------------------------------------------------------------------

[2004-06-22 05:34:56] michaelw at webcentral dot com dot au

Description:
------------
Attempting to set ini values within the obj.conf file (or
vserver.obj.conf if thats where your virtual hosts are pointed) fails
silently. 


This appears to be caused by the logic in sapi/nsapi/nsapi.c ( static
void nsapi_php_ini_entries(NSLS_D TSRMLS_DC) ) , in particular the
following snippet:

--- SNIP ---
ok=1;
for (j=0; nsapi_exclude_from_ini_entries[j]; j++) {
ok&=(!strcasecmp(entry->param->name,nsapi_exclude_from_ini_entries[j]));

}

if (ok) {
--- SNIP ---

It appears that ok is never returning as TRUE, and thus the code never
enters the if (ok) block. 

I modified it as follows (although I'm sure there are better ways..):

--- SNIP ---
ok=1;
for (j=0; nsapi_exclude_from_ini_entries[j]; j++) {
  if
(!strcasecmp(entry->param->name,nsapi_exclude_from_ini_entries[j]))    
   
    {
      ok = 0;
    }
  }
if (ok) {
--- SNIP ---

Additionally, the code that actually updates the ini value in the same
method):

--- SNIP ---
if (ok) {
  /* change the ini entry */
  if
(zend_alter_ini_entry(entry->param->name,strlen(entry->param->name)+1,entry->param->value,strlen(entry->param->value),PHP_INI_USER,PHP_INI_STAGE_RUNTIME)==FAILURE)
  
    {
      log_error(LOG_WARN, pblock_findval("fn", NSG(pb)),NSG(sn),
NSG(rq), "Cannot change php.ini key \"%s\" to \"%s\"",
entry->param->name, entry->param->value);
    }
}
--- SNIP ---

checks the method to see if it is PHP_INI_USER allowed, whilst since it
is in a system file (obj.conf or vserver.obj.conf) I would expect it to
test against PHP_INI_SYSTEM ?





------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=28878&edit=1

Reply via email to