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

We are discussing that at the moment. The problem is that SYSTEM values
are for the whole PHP library and are not thread specific (I think so),
so changing this in a php4_execute directive changes that value for all
currently running requests -> problem.

After discussing that i will decide to change this. All other
multithreaded SAPIs do it in that way (PHP_INI_USER)

doc_root can in PHP scripts accessed via $_SERVER['DOCUMENT_ROOT']


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

[2004-06-23 02:19:13] michaelw at webcentral dot com dot au

I've done a quick test, and the latest CVS STABLE release appears to
work correctly with regards to the ok &= line, although I haven't got
time to test it as fully as I would like to, so it would be nice if
someone else can confirm this... 

The latest CVS STABLE release still checks the key you are attempting
to set against PHP_INI_USER (and thus won't allow you to set things
such as open_basedir and doc_root), when I believe (as it is being set
in a system level file) that it should allow everything from
PHP_INI_SYSTEM (which will allow you to set open_basedir and doc_root)
?

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

[2004-06-22 17:38:24] [EMAIL PROTECTED]

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.

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

[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