php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68861 chown does not work when php is compiling with ZTS
Submitted: 2015-01-20 13:06 UTC Modified: -
Votes:8
Avg. Score:4.0 ± 0.7
Reproduced:8 of 8 (100.0%)
Same Version:3 (37.5%)
Same OS:8 (100.0%)
From: lg at efficientip dot com Assigned:
Status: Open Package: Filesystem function related
PHP Version: 5.6.4 OS: FreeBSD
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2015-01-20 13:06 UTC] lg at efficientip dot com
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


Patches

php_get_uid_by_name.patch (last revision 2015-01-20 13:07 UTC) by lg at efficientip dot com)

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Mon Jul 16 10:01:53 2018 UTC