From 882b78b52ceabb3a0b63de4006738d92c8c55360 Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Tue, 1 Mar 2022 16:27:20 -0800 Subject: meta-google: gbmc-ncsi-config: Restrict accepted hostnames We only want to allow valid prod hostnames such as `jtyl0` or `fgh10` and not hostnames like `ovss`. Change-Id: I0acf9405ff331a06526a52fe1b410458b122893a Signed-off-by: William A. Kennington III --- meta-google/recipes-google/ncsi/files/gbmc-ncsi-ip-from-ra.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'meta-google') diff --git a/meta-google/recipes-google/ncsi/files/gbmc-ncsi-ip-from-ra.sh.in b/meta-google/recipes-google/ncsi/files/gbmc-ncsi-ip-from-ra.sh.in index bd2f2becc9..6255f70858 100755 --- a/meta-google/recipes-google/ncsi/files/gbmc-ncsi-ip-from-ra.sh.in +++ b/meta-google/recipes-google/ncsi/files/gbmc-ncsi-ip-from-ra.sh.in @@ -108,7 +108,7 @@ while true; do pfx="$(ip_bytes_to_str t_pfx_b)" (( t_pfx_b[9] &= 0xf0 )) stateless_pfx="$(ip_bytes_to_str t_pfx_b)" - elif [[ "$line" =~ ^'DNS search list'' '*:' '*([^.-]*)[^.]*[.](.*.google.com)$ ]]; then + elif [[ "$line" =~ ^'DNS search list'' '*:' '*([a-z]+[0-9]+)[^.]*[.](.*.google.com)$ ]]; then host="${BASH_REMATCH[1]}" domain="${BASH_REMATCH[2]}" elif [[ "$line" =~ ^from' '(.*)$ ]]; then -- cgit v1.2.3