From 3be9407483439e27b0599f0bfe6b26f0012acacb Mon Sep 17 00:00:00 2001 From: cos Date: Thu, 13 Apr 2023 22:56:10 +0200 Subject: setup-interfaces: find essids when UTF-8 SSID capability present When a essid has the 'UTF-8 SSID' extended capibility, the `find_essids` function will not return that ssid. This bug is very similar to the one fixed in commit 6c9955e, and solved by ensuring nothing but whitespace precedes the matched key in the regex. Partial output of `iw dev wlan0 scan`: ``` Extended capabilities: * Extended Channel Switching * UTF-8 SSID * Operating Mode Notification ``` --- setup-interfaces.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup-interfaces.in b/setup-interfaces.in index 6ffcdd5..b44b5af 100644 --- a/setup-interfaces.in +++ b/setup-interfaces.in @@ -124,7 +124,7 @@ find_essids() { $MOCK ip link set dev "$iface" up (iw dev wlan0 scan; echo BSS) | awk -F": " ' /^BSS/ { if (ssid) { print ssid "/" auth }; ssid=""; auth="" } - $1 ~ /SSID$/ { ssid=$2 } + $1 ~ /^[[:blank:]]*SSID$/ { ssid=$2 } $1 ~ /Authentication suites/ { auth=$2 }' \ | grep -E -v '(802.1x|\\x00)' | sort -u >"$essids_list" if [ -s "$essids_list" ]; then -- cgit v1.2.3