[php-src] PR #13566: Fix GH-11808: Live filesystem modified by tests (security)
| From: | nielsdos | Date: | Fri, 01 Mar 2024 17:02:00 +0000 |
| Subject: | [php-src] PR #13566: Fix GH-11808: Live filesystem modified by tests (security) | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-25209@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/13566
Author: nielsdos
There's a test that tries to make /etc world-writable, and asserts that it fails. Although this
test is guarded by a root user check, there are situations where you don't need to be root to
be able to do this. This may thus have unwanted effects on your live filesystem.
The simple solution is to remove that part of the test. It doesn't really add value anyway:
we're trying to test the chmod error path, but that exact same error path can be reached with
any failure condition that the kernel gives. For example, trying to chmod a non-existent file will
trigger the same code path.
While at it, also prefix the test path for the non-existent file such that we don't
accidentally modify the filesystem.