fix: more accurate deny pattern for disk wiping

This commit is contained in:
kathent
2026-03-25 10:14:16 +08:00
parent cf9e0496f7
commit ae021ef843
+1 -1
View File
@@ -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).