]> granicus.if.org Git - php/commitdiff
Check permissions in pcntl_unshare_03.phpt
authorNikita Popov <nikita.ppv@gmail.com>
Mon, 10 Aug 2020 12:20:37 +0000 (14:20 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 10 Aug 2020 13:59:02 +0000 (15:59 +0200)
ext/pcntl/tests/pcntl_unshare_03.phpt

index b1217b630075b54770d1f8432363a356b5a20924..f82f27b71936fe18ec8c786a22c6bea7c05835c0 100644 (file)
@@ -9,10 +9,13 @@ if (!defined("CLONE_NEWNET")) die("skip flag unavailable");
 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");
+    die("skip Insufficient privileges for CLONE_NEWUSER");
+}
+if (@pcntl_unshare(CLONE_NEWNET) == false && pcntl_get_last_error() == PCNTL_EPERM) {
+    die("skip Insufficient privileges for CLONE_NEWPID");
 }
 if (getenv("SKIP_ONLINE_TESTS")) die("skip online test");
-
+?>
 --FILE--
 <?php