Bug #76837 [NEW]: chgrp doesn't work for secondary group

From: Date: Sun, 02 Sep 2018 16:31:03 +0000
Subject: Bug #76837 [NEW]: chgrp doesn't work for secondary group
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-216857@lists.php.net to get a copy of this message
From: bugs dot php dot net at register dot conactive dot com Operating system: Ubuntu 16.04 PHP version: 7.2.9 Package: *Directory/Filesystem functions Bug Type: Bug Bug description:chgrp doesn't work for secondary group 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 bug report at https://bugs.php.net/bug.php?id=76837&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=76837&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=76837&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=76837&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=76837&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=76837&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=76837&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=76837&r=needscript Try newer version: https://bugs.php.net/fix.php?id=76837&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=76837&r=support Expected behavior: https://bugs.php.net/fix.php?id=76837&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=76837&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=76837&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=76837&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76837&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=76837&r=dst IIS Stability: https://bugs.php.net/fix.php?id=76837&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=76837&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=76837&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=76837&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=76837&r=mysqlcfg

« previous php.bugs (#216857) next »