From ae021ef843f71ee4e3fc4a85b456912ce9c45350 Mon Sep 17 00:00:00 2001 From: kathent Date: Wed, 25 Mar 2026 10:14:16 +0800 Subject: [PATCH] fix: more accurate deny pattern for disk wiping --- pkg/tools/shell.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/tools/shell.go b/pkg/tools/shell.go index 78ad2b26d..24e2ea1cf 100644 --- a/pkg/tools/shell.go +++ b/pkg/tools/shell.go @@ -35,7 +35,7 @@ var ( regexp.MustCompile(`\brmdir\s+/s\b`), // Match disk wiping commands (must be followed by space/args) regexp.MustCompile( - `\b(format|mkfs|diskpart)\b\s`, + `(^|[^-\w])\b(format|mkfs|diskpart)\b\s`, ), regexp.MustCompile(`\bdd\s+if=`), // Block writes to block devices (all common naming schemes).