From 640d0dcef598f3a8e989443c337ab43f242f18dc Mon Sep 17 00:00:00 2001 From: Kenjiro Nakayama Date: Mon, 21 Mar 2022 13:27:39 +0900 Subject: [PATCH] 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. --- cargo-generate.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cargo-generate.toml b/cargo-generate.toml index e88d8be..d2b6b99 100644 --- a/cargo-generate.toml +++ b/cargo-generate.toml @@ -47,19 +47,19 @@ choices = [ "Ingress", "Egress" ] [conditional.'program_type == "sk_msg"'.placeholders.sock_map] type = "string" prompt = "Map Name (UPPER_CASE)?" -regex = "[A-Z_]+" +regex = "^[A-Z_]+$" [conditional.'program_type == "tracepoint"'.placeholders.tracepoint_category] type = "string" 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] type = "string" prompt = "Which tracepoint name? (e.g sched_switch, net_dev_queue)" -regex = "[a-z]+" +regex = "^[a-z_]+$" [conditional.'program_type == "lsm"'.placeholders.lsm_hook] 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." -regex = "[a-z]+" +regex = "^[a-z_]+$"