Bug #68861 [NEW]: chown does not work when php is compiling with ZTS
From: lg at efficientip dot com
Operating system: FreeBSD
PHP version: 5.6.4
Package: Filesystem function related
Bug Type: Bug
Bug description:chown does not work when php is compiling with ZTS
Description:
------------
chown() does not work when PHP is compiling with ZTS on FreeBSD, In fact
sysconf(_SC_GETGR_R_SIZE_MAX) may return -1 if there is no hard limit on
the size of the buffer needed to store all the groups returned.
Test script:
---------------
<?php
exec('touch /tmp/test')
chown('/tmp/test', 'www');
?>
Expected result:
----------------
root:/tmp # php test.php
root:/tmp # ls -l /tmp/test
-rw-r--r-- 1 www wheel 0 Jan 20 13:19 /tmp/test
Actual result:
--------------
root:/tmp # php test.php
Warning: chown(): Unable to find uid for www in /tmp/test.php on line 4
root:/tmp # ls -l /tmp/test
-rw-r--r-- 1 root wheel 0 Jan 20 13:19 /tmp/test
--
Edit bug report at https://bugs.php.net/bug.php?id=68861&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=68861&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=68861&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=68861&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=68861&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=68861&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=68861&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=68861&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=68861&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=68861&r=support
Expected behavior: https://bugs.php.net/fix.php?id=68861&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=68861&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=68861&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=68861&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=68861&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=68861&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=68861&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=68861&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=68861&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=68861&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=68861&r=mysqlcfg
Thread (3 messages)
- lg at efficientip dot com