#28878 [Opn->Fbk]: Setting of inikey's in obj.conf fails

From: Date: Tue, 22 Jun 2004 14:24:06 +0000
Subject: #28878 [Opn->Fbk]: Setting of inikey's in obj.conf fails
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-61215@lists.php.net to get a copy of this message
ID: 28878 Updated by: iliaa@php.net Reported By: michaelw at webcentral dot com dot au -Status: Open +Status: Feedback Bug Type: iPlanet related Operating System: Solaris 9 PHP Version: 4.3.7 New Comment: 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])); Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#61215) next »