ID:               37823
 Updated by:       [EMAIL PROTECTED]
 Reported By:      james-php at bytehosting dot com
-Status:           Open
+Status:           Closed
 Bug Type:         POSIX related
 Operating System: mandriva2006.0 - linux 2.6.12-22
 PHP Version:      5.1.4
 New Comment:

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

The posix_initgroups() was added in CVS.


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

[2006-06-16 01:07:42] james-php at bytehosting dot com

Description:
------------
When calling posix_get[e]gid() to drop root privledges, it does NOT
logout of group=0(root).

Please look VERY closely at the 'id' output from the script, you will
see that the third section "groups=" shows that i am effectively still
logged into group "0".

It indeed sets the current process group id to 0, however, it does NOT
completely DROP all group memeberships, as well PHP provides no
"posix_initgroups()" so there is no way to call initgroups() on linux
to re-init the group memeberships from /etc/group, which would
effectively, or should, drop the group=0(root) membership.

Reproduce code:
---------------
<?
 system("id");
 posix_setgid(500);
 posix_setegid(500);
 posix_setuid(500);
 posix_seteuid(500);
 system("id");
?>

Expected result:
----------------
[EMAIL PROTECTED] cluster]# php test.php
uid=0(root) gid=0(root) groups=0(root)
uid=500(cluster) gid=500(cluster) groups=500(cluster)
[EMAIL PROTECTED] cluster]#

Actual result:
--------------
[EMAIL PROTECTED] cluster]# php test.php
uid=0(root) gid=0(root) groups=0(root)
uid=500(cluster) gid=500(cluster) groups=0(root)
[EMAIL PROTECTED] cluster]#


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


-- 
Edit this bug report at http://bugs.php.net/?id=37823&edit=1

Reply via email to