From 8428d93f5f4699502d9fb4131245ce40a4df3268 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'); }