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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: bugs dot php dot net at register dot conactive dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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 Oct 04 06:01:26 2024 UTC