diff options
author | William A. Kennington III <wak@google.com> | 2022-03-02 03:27:20 +0300 |
---|---|---|
committer | William A. Kennington III <wak@google.com> | 2022-03-07 20:53:51 +0300 |
commit | 882b78b52ceabb3a0b63de4006738d92c8c55360 (patch) | |
tree | f9dc20f316595befb9f3bb03ee9b8c77f3e001ed /meta-google | |
parent | 91da5203e3d406de0f8ddfb86dd99ef79959de3d (diff) | |
download | openbmc-882b78b52ceabb3a0b63de4006738d92c8c55360.tar.xz |
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 <wak@google.com>
Diffstat (limited to 'meta-google')
-rwxr-xr-x | meta-google/recipes-google/ncsi/files/gbmc-ncsi-ip-from-ra.sh.in | 2 |
1 files changed, 1 insertions, 1 deletions
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 |