diff options
Diffstat (limited to 'cli_args.go')
-rw-r--r-- | cli_args.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/cli_args.go b/cli_args.go index 7743120..ce15448 100644 --- a/cli_args.go +++ b/cli_args.go @@ -10,6 +10,7 @@ import ( "fmt" "net" "os" + "path/filepath" "strconv" "strings" "time" @@ -290,6 +291,15 @@ func parseCliOpts() (args argContainer) { tlog.Fatal.Printf("Idle timeout cannot be less than 0") os.Exit(exitcodes.Usage) } + // Make sure all badname patterns are valid + for _, pattern := range args.badname { + _, err := filepath.Match(pattern, "") + if err != nil { + tlog.Fatal.Printf("-badname: invalid pattern %q supplied", pattern) + os.Exit(exitcodes.Usage) + } + } + return args } |