Add allowed commands

This commit is contained in:
crazywhalecc
2024-10-05 10:55:53 +08:00
parent 1be20ca37d
commit 8428d93f5f

View File

@@ -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');
}