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.
This commit is contained in:
Nikita Popov 2019-10-24 12:19:24 +02:00
parent 69b608cf13
commit a3469146d4

View file

@ -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--