Bug #80492 [NEW]: CHMOD does not work

From: Date: Mon, 07 Dec 2020 17:30:43 +0000
Subject: Bug #80492 [NEW]: CHMOD does not work
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-230917@lists.php.net to get a copy of this message
From: gilperon at gmail dot com Operating system: CENTOS 7 and 8 PHP version: 8.0.0 Package: *General Issues Bug Type: Bug Bug description:CHMOD does not work Description: ------------ This bug happens also on PHP 7.X and 8.X. When using PHP command "chmod(filename,persmission);" on a file owned by "root", PHP will say "Operation not permitted". Alright, it looks fine, since apache runs as "apache" user. HOWEVER I can easily use "unlink", "move_uploaded_file", "file_put_contents" and many other PHP functions on files OWNED BY ROOT and any other user. So why cant "chmod" change the file permission of a file that other PHP functions may well EVEN DELETE OR WRITE to that file, despite being owned by another user on ther server. I can see how this isnt a bug and it took me 3 hours to get to the bottom of it cause I couldnt belive what was happening since I could easily read/write to files but weirdly, "chmod" couldnt change permission. Test script: --------------- chdmod(filename,0777) Expected result: ---------------- permission should be shown Actual result: -------------- OPERATION NOT PERMITTED. -- Edit bug report at https://bugs.php.net/bug.php?id=80492&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=80492&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=80492&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=80492&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=80492&r=needscript Try newer version: https://bugs.php.net/fix.php?id=80492&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=80492&r=support Expected behavior: https://bugs.php.net/fix.php?id=80492&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=80492&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=80492&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=80492&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=80492&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=80492&r=dst IIS Stability: https://bugs.php.net/fix.php?id=80492&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=80492&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=80492&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=80492&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=80492&r=mysqlcfg

« previous php.bugs (#230917) next »