From:             michaelw at webcentral dot com dot au
Operating system: Solaris 9
PHP version:      4.3.7
PHP Bug Type:     iPlanet related
Bug description:  Setting of inikey's in obj.conf fails

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 bug report at http://bugs.php.net/?id=28878&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=28878&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=28878&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=28878&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=28878&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=28878&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=28878&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=28878&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=28878&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=28878&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=28878&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=28878&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=28878&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28878&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=28878&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=28878&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=28878&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28878&r=float

Reply via email to