php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76837 chgrp doesn't work for secondary group
Submitted: 2018-09-02 16:31 UTC Modified: 2018-09-02 20:55 UTC
From: bugs dot php dot net at register dot conactive dot com Assigned:
Status: Not a bug Package: *Directory/Filesystem functions
PHP Version: 7.2.9 OS: Ubuntu 16.04
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
21 + 49 = ?
Subscribe to this entry?

 
 [2018-09-02 16:31 UTC] 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.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-09-02 16:38 UTC] bugs dot php dot net at register dot conactive dot com
-Status: Open +Status: Closed
 [2018-09-02 16:38 UTC] 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 18:15 UTC] spam2 at rhsoft dot net
and even if - PHP don't implement such system functions at it's own but calling the underlying OS
 [2018-09-02 20:55 UTC] requinix@php.net
-Status: Closed +Status: Not a bug
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 15:01:28 2024 UTC