#17466 [Com]: Safe mode uid -1 bug

From: Date: Fri, 23 Aug 2002 20:40:47 +0000
Subject: #17466 [Com]: Safe mode uid -1 bug
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-17697@lists.php.net to get a copy of this message
ID: 17466 Comment by: shollatz@d.umn.edu Reported By: cjones@dualboot.net Status: Open Bug Type: Apache2 related Operating System: Linux 2.4.7-10 PHP Version: 4.2.1 New Comment: While this may have been assigned as an Apache 2.x problem, I observe safe_mode_gid not working for most GIDs, works for a few, regardless whether the user's GID set includes it. The environment is Apache 1.3.26 with PHP 4.2.2 as a module, under Solaris 2.8. Previous Comments: ------------------------------------------------------------------------ [2002-06-20 15:14:06] brian@brian-web.com That patch I just posted is broken with Apache 2.0.39, apparently the finfo struct isn't filled in 2.0.39 at the point that I was accessing it. (Its all 0s). If you move the call to php_apr_finfo2stat to php_apache_get_stat it works, but then its runs everytime php_apache_get_stat is called, which I was trying to avoid. ------------------------------------------------------------------------ [2002-06-20 03:07:29] brian@brian-web.com I hit the same problem too with apache 2.0.36/php 4.2.1. I figured out where the problem was and fixed it. The apache2filter sapi module wasn't implementing a get_stat function. You can grab the patch from: http://www.brian-web.com/misc/apache2-php-safemode.patch I'm not too familiar with the Apache2 or PHP source, so someone else should probably take a look at it. Basically, it takes the apr_finfo_t struct from apache and converts it back to a struct stat for php. ------------------------------------------------------------------------ [2002-05-28 02:24:18] derick@php.net reclassify as an apache 2 issue ------------------------------------------------------------------------ [2002-05-28 01:15:24] cjones@dualboot.net Update. I installed the CVS release (4.3.0-dev) and the problem still exists there. I switched over to the CGI/commandline install of PHP (4.2.1) and it works correctly (i.e. when safe_mode is on it gets the correct uid of the file owner). ------------------------------------------------------------------------ [2002-05-27 20:53:17] cjones@dualboot.net Little bit of extra info (which may or may not be helpful), OS version: Linux version 2.4.7-10smp (bhcompile@stripples.devel.redhat.com) (gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-98)) #1 SMP Thu Sep 6 17:09:31 EDT 2001 Apache config commands: ./configure --prefix=/usr/local/apache --enable-so --enable-rewrite=shared --enable-ssl=shared --enable-suxec=shared PHP config commands: ./configure --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/apache/bin/apxs ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/17466 -- Edit this bug report at http://bugs.php.net/?id=17466&edit=1

« previous php.bugs (#17697) next »