[PHP-BUG] Bug #74357 [NEW]: lchown fails to change ownership of symlink with ZTS

[email protected] ("msaladna at apisnetworks dot com")
Newsgroups php.bugs
Message-ID <[email protected]>
From:             msaladna at apisnetworks dot com
Operating system: CentOS 7.3
PHP version:      7.1.3
Package:          Filesystem function related
Bug Type:         Bug
Bug description:lchown fails to change ownership of symlink with ZTS

Description:
------------
Compiling PHP with ZTS affects performance of lchown and lchgrp. 

PHP CLI compiled without ZTS:

./configure --disable-all

ZTS is above + '--enable-maintainer-zts'

Test script:
---------------
<?php
   echo "TS: ", PHP_ZTS, "\n";
   is_link("foo") && unlink("foo");
   symlink("/tmp", "foo");
   lchown("foo", 99);
   var_dump(lstat("foo")['uid']);
?>

Expected result:
----------------
TS: 1
int(99)

Actual result:
--------------
TS: 1
int(0)

-- 
Edit bug report at https://bugs.php.net/bug.php?id=74357&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=74357&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=74357&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=74357&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=74357&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=74357&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=74357&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=74357&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=74357&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=74357&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=74357&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=74357&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=74357&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=74357&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74357&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=74357&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=74357&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=74357&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=74357&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=74357&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=74357&r=mysqlcfg
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.