Use strict regex for additional args.

Current `[a-z_]+` regex allows upper case such as `NET_dev`, `netDev`
or even `NET_DEV` when one of `a-z` or `_` contains in the string. It
should be disallowed.

This patch fixes it.
pull/36/head
Kenjiro Nakayama 3 years ago
parent 8cde8c2232
commit 640d0dcef5

@ -47,19 +47,19 @@ choices = [ "Ingress", "Egress" ]
[conditional.'program_type == "sk_msg"'.placeholders.sock_map] [conditional.'program_type == "sk_msg"'.placeholders.sock_map]
type = "string" type = "string"
prompt = "Map Name (UPPER_CASE)?" prompt = "Map Name (UPPER_CASE)?"
regex = "[A-Z_]+" regex = "^[A-Z_]+$"
[conditional.'program_type == "tracepoint"'.placeholders.tracepoint_category] [conditional.'program_type == "tracepoint"'.placeholders.tracepoint_category]
type = "string" type = "string"
prompt = "Which tracepoint category? (e.g sched, net etc...)" prompt = "Which tracepoint category? (e.g sched, net etc...)"
regex = "[a-z]+" regex = "^[a-z_]+$"
[conditional.'program_type == "tracepoint" || program_type == "tp_btf"'.placeholders.tracepoint_name] [conditional.'program_type == "tracepoint" || program_type == "tp_btf"'.placeholders.tracepoint_name]
type = "string" type = "string"
prompt = "Which tracepoint name? (e.g sched_switch, net_dev_queue)" prompt = "Which tracepoint name? (e.g sched_switch, net_dev_queue)"
regex = "[a-z]+" regex = "^[a-z_]+$"
[conditional.'program_type == "lsm"'.placeholders.lsm_hook] [conditional.'program_type == "lsm"'.placeholders.lsm_hook]
type = "string" type = "string"
prompt = "Which lsm hook? (e.g file_open, task_alloc) You can find a list of hooks in include/linux/lsm_hooks.h in the kernel source tree." prompt = "Which lsm hook? (e.g file_open, task_alloc) You can find a list of hooks in include/linux/lsm_hooks.h in the kernel source tree."
regex = "[a-z]+" regex = "^[a-z_]+$"

Loading…
Cancel
Save