pavel's fix for scans with spaces etc.

This commit is contained in:
solomon 2002-12-19 16:02:53 +00:00
parent b864bcd08e
commit 36643f48fd
2 changed files with 23 additions and 21 deletions

View file

@ -42,6 +42,7 @@
*
* --------------------------------------------------------------------
-pre8
- Patch to allow escaped characters in the scan list (Pavel Roskin)
- Re-added the txfid queue locking which somehow got dropped.
- Added DellTrueMobile 1180 USB ident. (Michael Hackett)
- Changed linkstatus messages to INFO level reporting.

View file

@ -189,24 +189,24 @@ wlan_ssid_in_list ()
# XXX what about stray singlequotes.
eval 'GOSSID="$SSID_'$1'"'
for token in $GOSSID ; do
# XXX: process token for spaces
# This "eval" hackery is to allow escapes in GOSSID...
cmd="for token in $GOSSID ; do
ssid_token=\`echo \"\$token\" | sed -ne 's/\(.*\)\(:..:..:..:..:..:..\).*/\1/p'\`
bssid_token=\`echo \"\$token\" | sed -ne 's/\(.*\):\(..:..:..:..:..:..\).*/\2/p'\`
ssid_token=`echo $token | sed -ne 's/\(.*\)\(:..:..:..:..:..:..\).*/\1/p'`
bssid_token=`echo $token | sed -ne 's/\(.*\):\(..:..:..:..:..:..\).*/\2/p'`
if [ X"$ssid_token" = X"" ] ; then
ssid_token="$token"
if [ \"X\$ssid_token\" = X ] ; then
ssid_token="\$token"
fi
if [ X"$bssid_token" != X"" ] ; then
if [ "$bssid_token" = "$3" ] ; then
if [ \"X\$bssid_token\" != X ] ; then
if [ \"\$bssid_token\" = \"\$3\" ] ; then
return 0
fi
elif [ "$2" = "$ssid_token" ] ; then
elif [ \"\$2\" = \"\$ssid_token\" ] ; then
return 0
fi
done
done"
eval "$cmd"
return 1
}
@ -215,7 +215,7 @@ wlan_supports_scan ()
{
# $1 == wlandev
grep 'scan' /proc/net/p80211/$DEVICE/wlandev > /dev/null
grep 'scan' /proc/net/p80211/$1/wlandev > /dev/null
if [ $? = 0 ] ; then
return 0
@ -247,20 +247,21 @@ wlan_scan ()
fi;
# otherwise we walk through the list, and scan for eacn in turn.
# this "eval" hackery is to allow escapes in GOSSID
cmd="for token in $GOSSID ; do
ssid_token=\`echo \"\$token\" | sed -ne 's/\(.*\)\(:..:..:..:..:..:..\).*/\1/p'\`
bssid_token=\`echo \"\$token\" | sed -ne 's/\(.*\):\(..:..:..:..:..:..\).*/\2/p'\`
for token in $GOSSID ; do
ssid_token=`echo $token | sed -ne 's/\(.*\)\(:..:..:..:..:..:..\).*/\1/p'`
bssid_token=`echo $token | sed -ne 's/\(.*\):\(..:..:..:..:..:..\).*/\2/p'`
if [ X"$ssid_token" = X"" ] ; then
ssid_token="$token"
if [ \"X\$ssid_token\" = X ] ; then
ssid_token=\"\$token\"
fi
wlan_scan_one $1 "$ssid_token" "$bssid_token"
if [ $? = 0 ] ; then
wlan_scan_one \$1 \"\$ssid_token\" \"\$bssid_token\"
if [ \$? = 0 ] ; then
return 0
fi
done
done"
eval "$cmd"
# We got to the end of the list. Maybe try "any"
if is_true "$WLAN_ANY" ; then