Skip to content

Commit 74b285d

Browse files
committed
Merge branch 'PHP-7.4'
* PHP-7.4: Check ps -p availability in process title test Add privilege check in pcntl_unshare test
2 parents 52047ad + 99645f5 commit 74b285d

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

ext/pcntl/tests/pcntl_unshare_02.phpt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ if (!defined("CLONE_NEWPID")) die("skip flag unavailable");
99
if (getenv("SKIP_ASAN")) die("skip asan chokes on this");
1010
if (posix_getuid() !== 0 &&
1111
(!defined("CLONE_NEWUSER") ||
12-
(pcntl_unshare(CLONE_NEWUSER) == false && pcntl_get_last_error() == PCNTL_EPERM))) {
13-
die("skip Insufficient previleges to run test");
12+
(@pcntl_unshare(CLONE_NEWUSER) == false && pcntl_get_last_error() == PCNTL_EPERM))) {
13+
die("skip Insufficient privileges for CLONE_NEWUSER");
14+
}
15+
if (@pcntl_unshare(CLONE_NEWPID) == false && pcntl_get_last_error() == PCNTL_EPERM) {
16+
die("skip Insufficient privileges for CLONE_NEWPID");
1417
}
1518

1619
--FILE--

sapi/cli/tests/cli_process_title_unix.phpt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ if (PHP_SAPI !== "cli")
77
if (!PHP_CLI_PROCESS_TITLE)
88
die("skip process title not available (disabled or unsupported)");
99
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')
10-
die("skip");
10+
die("skip Not for Windows");
11+
12+
exec("ps -p 1", $output, $exit_code);
13+
if ($exit_code !== 0) {
14+
die("skip ps -p is not available");
15+
}
1116
?>
1217
--FILE--
1318
<?php

0 commit comments

Comments
 (0)