Bug #76837 [Com]: chgrp doesn't work for secondary group
| From: | spam2 at rhsoft dot net | Date: | Sun, 02 Sep 2018 18:15:58 +0000 |
| Subject: | Bug #76837 [Com]: chgrp doesn't work for secondary group | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-216859@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76837&edit=1
ID: 76837
Comment by: spam2 at rhsoft dot net
Reported by: bugs dot php dot net at register dot conactive dot
com
Summary: chgrp doesn't work for secondary group
Status: Closed
Type: Bug
Package: *Directory/Filesystem functions
Operating System: Ubuntu 16.04
PHP Version: 7.2.9
Block user comment: N
Private report: N
New Comment:
and even if - PHP don't implement such system functions at it's own but calling the
underlying OS
Previous Comments:
------------------------------------------------------------------------
[2018-09-02 16:38:45] bugs dot php dot net at register dot conactive dot com
Sorry, false alarm. I had forgotten to restart the fpm manager process. After restarting it works!
Bug can be closed!
------------------------------------------------------------------------
[2018-09-02 16:31:03] bugs dot php dot net at register dot conactive dot com
Description:
------------
Problem with chgrp: it doesn't change group for a secondary group.
Documentation on http://php.net/chgrp says "other users may
change the group of a file to any group of which that user is a member." So, this implies it
can change it not only to the primary group but also to any secondary group identfied by /etc/group.
Also, the function would be pretty much useless then as only the super user could use it.
That doesn't work. I added the user www-data to the group vmail and then tried to chgrp a file
that is owned by www-data (which is also the pool user) to vmail. I get a warning: chgrp():
Operation not permitted
Might be an fpm problem? e.g. fpm not being aware that user also belongs to other groups as group =
www.data ?
I did not check if chgrp works with primary group. That was not the goal.
I tested on the shell by su-ing to www-data and was able to change the group this way. So, the user
www-data does have enough permissions. php-fpm just doesn't seem to recognize that.
Expected result:
----------------
chgrp function should be able to chgrp to *any* (=every) group the owner of the fpm process belongs
to.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76837&edit=1