com php-src: Use posix_getuid() to check for root in pcntl_setpriority() test: ext/pcntl/tests/p cntl_setpriority_basic.phpt
| From: | Nikita Popov | Date: | Thu, 24 Oct 2019 12:46:25 +0000 |
| Subject: | com php-src: Use posix_getuid() to check for root in pcntl_setpriority() test: ext/pcntl/tests/p cntl_setpriority_basic.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-109043@lists.php.net to get a copy of this message | ||
Commit: a3469146d49027fe0260c7d3c642c4b37a5e032f
Author: Nikita Popov <nikita.ppv@gmail.com> Thu, 24 Oct 2019 12:19:24 +0200
Parents: 69b608cf13f24f7859e564254263fa789e722211
Branches: PHP-7.4 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a3469146d49027fe0260c7d3c642c4b37a5e032f
Log:
Use posix_getuid() to check for root in pcntl_setpriority() test
Using SUDO_USER doesn't seem to work on Travis ARM CI -- I guess
that sudo might be in use without the target being root.
Changed paths:
M ext/pcntl/tests/pcntl_setpriority_basic.phpt
Diff:
diff --git a/ext/pcntl/tests/pcntl_setpriority_basic.phpt
b/ext/pcntl/tests/pcntl_setpriority_basic.phpt
index 1f03fb2dc96..235b0ec9ceb 100644
--- a/ext/pcntl/tests/pcntl_setpriority_basic.phpt
+++ b/ext/pcntl/tests/pcntl_setpriority_basic.phpt
@@ -5,14 +5,14 @@ Er Galvão Abbott galvao@galvao.eti.br
# TestFest 2017 PHPRS PHP UG 2017-10-31
--SKIPIF--
<?php
-if (!isset($_SERVER['SUDO_USER'])) {
- die('skip - this functions needs to run with superuser');
-}
-
if (!extension_loaded('pcntl')) {
- die('skip - ext/pcntl not loaded');
-} else if (!function_exists('pcntl_setpriority')) {
- die('skip - pcntl_setpriority doesn\'t exist');
+ die('skip ext/pcntl not loaded');
+}
+if (!function_exists('pcntl_setpriority')) {
+ die('skip pcntl_setpriority doesn\'t exist');
+}
+if (!function_exists('posix_getuid') || posix_getuid() !== 0) {
+ die('skip this functions needs to run with superuser');
}
?>
--FILE--