Merge pull request #1982 from Kathent/fix-deny-pattern

fix: more accurate deny pattern for disk wiping
This commit is contained in:
Mauro 2026-03-30 14:24:17 +02:00 committed by GitHub
commit ffa65b53ed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -52,7 +52,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).