com php-src: Add privilege check in pcntl_unshare test: ext/pcntl/tests/pcntl_unshare_02.phpt
| From: | Nikita Popov | Date: | Wed, 05 Aug 2020 16:18:06 +0000 |
| Subject: | com php-src: Add privilege check in pcntl_unshare test: ext/pcntl/tests/pcntl_unshare_02.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-112586@lists.php.net to get a copy of this message | ||
Commit: 8fd79d35742c799c59cfc090d8cfdbe1f93b4f3a
Author: Nikita Popov <nikita.ppv@gmail.com> Wed, 5 Aug 2020 09:53:22 +0200
Parents: 3b86be23e6641c2a298bf381d39346177223176a
Branches: PHP-7.4 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8fd79d35742c799c59cfc090d8cfdbe1f93b4f3a
Log:
Add privilege check in pcntl_unshare test
Privileges for CLONE_NEWPID were not checked.
Changed paths:
M ext/pcntl/tests/pcntl_unshare_02.phpt
Diff:
diff --git a/ext/pcntl/tests/pcntl_unshare_02.phpt b/ext/pcntl/tests/pcntl_unshare_02.phpt
index bdcb6120ef..cafd64dd96 100644
--- a/ext/pcntl/tests/pcntl_unshare_02.phpt
+++ b/ext/pcntl/tests/pcntl_unshare_02.phpt
@@ -9,8 +9,11 @@ if (!defined("CLONE_NEWPID")) die("skip flag unavailable");
if (getenv("SKIP_ASAN")) die("skip asan chokes on this");
if (posix_getuid() !== 0 &&
(!defined("CLONE_NEWUSER") ||
- (pcntl_unshare(CLONE_NEWUSER) == false && pcntl_get_last_error() == PCNTL_EPERM))) {
- die("skip Insufficient previleges to run test");
+ (@pcntl_unshare(CLONE_NEWUSER) == false && pcntl_get_last_error() == PCNTL_EPERM))) {
+ die("skip Insufficient privileges for CLONE_NEWUSER");
+}
+if (@pcntl_unshare(CLONE_NEWPID) == false && pcntl_get_last_error() == PCNTL_EPERM) {
+ die("skip Insufficient privileges for CLONE_NEWPID");
}
--FILE--