ID: 29207 Comment by: dsmk at bu dot edu Reported By: ksvee at usit dot uio dot no Status: Open Bug Type: Filesystem function related Operating System: Solaris 8 PHP Version: 4.3.10RC1 New Comment:
FYI, I just tested 4.3.10RC2 and its still there. Previous Comments: ------------------------------------------------------------------------ [2004-12-03 21:38:32] dsmk at bu dot edu Just wanted to add that I have reproduced the problem on Solaris 8 with all the versions above 4.3.8 including 4.3.10RC1 and 5.0.2. My production Apache is a security patched 1.3.26 but I have also seen the problem with a generic 1.3.31. ------------------------------------------------------------------------ [2004-07-16 12:53:24] ksvee at usit dot uio dot no Description: ------------ This is really an old bug that seems to be coming and going, but I cannot find an open bug on it. References: bugs #18500, #12683 and #7744 The latest version that this bug is not alive and well is 4.2.3 which is the one we still use. I've tested (just about) every (release) version since, and reproduced the bug in all of them. That includes the latest (4.3.8) tested today, 2004-07-16. I use PHP with Apache 1.3.x (1.3.31 latest). Description: When using SAFE_MODE = ON, php reports uid=1 on the running php-script as well as its proper uid: ----- [datetag] [error] PHP Warning: Unknown(): SAFE MODE Restriction in effect. The script whose uid is 1 is not allowed to access /path/to/script.php owned by uid 26658 in Unknown on line 0 ----- If I chown the script to another user, e.g. root, the report looks like this: ----- [datetag] [error] PHP Warning: Unknown(): SAFE MODE Restriction in effect. The script whose uid is 1 is not allowed to access /path/to/script.php owned by uid 0 in Unknown on line 0 ----- If i chown it to uid=1 ('daemon' on my systems) then it seems to work, except that the file I intend to include also needs to be owned by daemon. This included file at least seems to have its owner reported correctly, the full report being: ----- [datetag] [error] PHP Warning: main(): SAFE MODE Restriction in effect. The script whose uid is 1 is not allowed to access ./filename.inc owned by uid 26658 in /a/b/c/include.php on line 2 [datetag] [error] PHP Warning: main(filename.inc): failed to open stream: Error 0 in /a/b/c/include.php on line 2 [datetag] [error] PHP Warning: main(): Failed opening 'filename.inc' for inclusion (include_path='.') in /a/b/c/include.php on line 2 ----- We usually use a non-standard config, compiling Apache, PHP, OpenSSL etc under a specific prefix, but dumbing this to default paths has no impact. Using "--with-apxs=/path/to/apxs --prefix=/path/to/installprefix" as the only config parameters to PHP too has no impact on the results. As for php.ini, I've tried using a clean copy of both "php.ini-recommended" and "php.ini-dist" with no other modifications than setting "safe_mode = On". No significant changes. Rgds, Kenneth Svee Reproduce code: --------------- # Content of include.php: <?php include("filename.inc"); ?> # (filename.inc is in same dir as include.php, and # contains just an arbitrary string, e.g.: "I've been included!" Expected result: ---------------- # I expected the string in filename.inc: "I've been included!" Actual result: -------------- Just the empty page, and the errormessages in Apaches error_log. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=29207&edit=1