diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-08-05 18:18:51 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-08-05 18:18:51 +0200 |
commit | 74b285d78caf92364584397c2d986ad35cdeb856 (patch) | |
tree | 9053541783c79d2d4f9607bcbbbf7f3141cac84b | |
parent | 52047addc79b067d302c4fb23e235b0e530f9a70 (diff) | |
parent | 99645f5352b5dc9faaece36f606edfff5f7a7460 (diff) | |
download | php-git-74b285d78caf92364584397c2d986ad35cdeb856.tar.gz |
Merge branch 'PHP-7.4'
* PHP-7.4:
Check ps -p availability in process title test
Add privilege check in pcntl_unshare test
-rw-r--r-- | ext/pcntl/tests/pcntl_unshare_02.phpt | 7 | ||||
-rw-r--r-- | sapi/cli/tests/cli_process_title_unix.phpt | 7 |
2 files changed, 11 insertions, 3 deletions
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-- diff --git a/sapi/cli/tests/cli_process_title_unix.phpt b/sapi/cli/tests/cli_process_title_unix.phpt index d6e49a2221..166cb79ad3 100644 --- a/sapi/cli/tests/cli_process_title_unix.phpt +++ b/sapi/cli/tests/cli_process_title_unix.phpt @@ -7,7 +7,12 @@ if (PHP_SAPI !== "cli") if (!PHP_CLI_PROCESS_TITLE) die("skip process title not available (disabled or unsupported)"); if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') - die("skip"); + die("skip Not for Windows"); + +exec("ps -p 1", $output, $exit_code); +if ($exit_code !== 0) { + die("skip ps -p is not available"); +} ?> --FILE-- <?php |