From 648c43cc7f2b98f90d1b5d99d278a1175e93ea1e Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Sat, 5 Oct 2024 10:55:53 +0800 Subject: [PATCH] Add allowed commands --- tests/mock/SPC_store.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/mock/SPC_store.php b/tests/mock/SPC_store.php index 6969e128..9ee59093 100644 --- a/tests/mock/SPC_store.php +++ b/tests/mock/SPC_store.php @@ -63,5 +63,13 @@ function f_passthru(string $cmd): bool return true; } + // allowed commands + $allowed = ['cp', 'copy', 'xcopy']; + foreach ($allowed as $a) { + if (str_starts_with($cmd, $a)) { + \f_passthru($cmd); + return true; + } + } throw new RuntimeException('Invalid tests'); }