php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49810 safe_mode uid/gid are always 0/1024
Submitted: 2009-10-08 08:48 UTC Modified: 2009-10-19 17:12 UTC
From: php-dev at micallef dot fr Assigned:
Status: Not a bug Package: Safe Mode/open_basedir
PHP Version: 5.2.11 OS: Solaris 10
Private report: No CVE-ID: None
 [2009-10-08 08:48 UTC] php-dev at micallef dot fr
Description:
------------
Hello,

We have a Sparc T2000 with coolstack for apache (v2.2.9) and php 5.2.11.
When I activate safe_mode, we have this error : 

Warning: Unknown: SAFE MODE Restriction in effect. The script whose uid/gid is 1/1024 is not allowed to access /david/SHERPA/index.php owned by uid/gid 1024/512 in Unknown on line 0

Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0

Fatal error: Unknown: Failed opening required '/test/php/index.php' (include_path='.:/opt/php-5.2.11/includes') in Unknown on line 0

I suppose that de problem come with function php_getuid and php_getgid.

I have done same test on RHEL_5 and I haven't any problem.

Do you have a idea ?

Reproduce code:
---------------
<?php
//echo "teste";
echo "uid = " . getmyuid() . "\n";
echo "gid = " . getmygid() . "\n";

//echo file_get_contents('/etc/passwd');
//echo file_get_contents('test.txt');

//phpinfo();
?>


Expected result:
----------------
Warning: Unknown: SAFE MODE Restriction in effect. The script whose uid/gid is 1/1024 is not allowed to access /david/SHERPA/index.php owned by uid/gid 1024/512 in Unknown on line 0

Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0

Fatal error: Unknown: Failed opening required '/test/php/index.php' (include_path='.:/opt/php-5.2.11/includes') in Unknown on line 0


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-10-19 15:07 UTC] jani@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.



 [2009-10-19 17:12 UTC] srinatar@php.net
this is not a php bug. i recommend closing this as bogus. 

i have heard this issue from some of my other customers using cool stack 
as well. it turns out that apache in cool stack is compiled with -
D_FILE_OFFSET_BITS=64 and php is not compiled with this similar flags. 

when one uses -D_FILE_OFFSET_BITS=64, stat file structure size used with 
both apache as well as php's apache sapi module is different. hence, you 
are running into this issue. 

this issue is already reported in cool stack forum multiple time. please 
check out their new version known as web stack under 
http://www.sun.com/webstack and this should address your concern. 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 00:01:27 2024 UTC