|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-05-27 20:53 UTC] cjones at dualboot dot net
[2002-05-28 01:15 UTC] cjones at dualboot dot net
[2002-05-28 02:24 UTC] derick@php.net
[2002-06-20 03:07 UTC] brian at brian-web dot com
[2002-06-20 15:14 UTC] brian at brian-web dot com
[2002-08-23 16:40 UTC] shollatz at d dot umn dot edu
[2002-08-29 15:09 UTC] slamb at slamb dot org
[2002-09-16 10:30 UTC] derick@php.net
[2002-09-23 13:56 UTC] iliaa@php.net
[2002-12-17 04:38 UTC] romio at aduva dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 14:00:01 2025 UTC |
When safe mode is on php is unable to determine the uid of the running script, it reports it as -1. As you might imagine, this completely breaks the utility of safe mode with respect to file access. Also, the same bug occurs when using safe_mode_gid (it reports the gid as -1 as well). Note that it does get the appropriate uid/gid for the file that is attempted to be accessed. I am running Apache 2.0.36 and the newest version of PHP (4.2.1). I did some poking around and I think I found out what's going on. In ext/standard/pageinfo.c, php_statpage() tries to determine and stat the running script file like so: -------------------------------------------- pstat = sapi_get_stat(TSRMLS_C); if (BG(page_uid)==-1 || BG(page_gid)==-1) { if(pstat) { BG(page_uid) = pstat->st_uid; BG(page_gid) = pstat->st_gid; BG(page_inode) = pstat->st_ino; BG(page_mtime) = pstat->st_mtime; } } -------------------------------------------- pstat is not properly set by sapi_get_stat() (from main/SAPI.c) so the page_uid et al values are not changed, and retain their defaults (-1). I looked around a bit to see if I could make a workaround by stating the script file without using sapi_get_stat but I couldn't figure out what variable contained the script filename.