mirror of
https://github.com/php/php-src.git
synced 2024-09-22 10:27:25 +00:00
Add privilege check in pcntl_unshare test
Privileges for CLONE_NEWPID were not checked.
This commit is contained in:
parent
3b86be23e6
commit
8fd79d3574
@ -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--
|
||||
|
Loading…
Reference in New Issue
Block a user