You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I see the point, but the example provided does not fail. Line 87 is actually:
var start = line.split(/\s[0-9a-f]{2}[:|-]/);
Which means that the string will be cut when ver a space followed by two chars and either : or - is found. So unless the SSID contains something like " AF:" or " 12-" (with a leading space) it will work.
I do agree that using the XML output is a better approach, though. Feel free to send a pull request. ;)
Issue
FILE: lib/agent/providers/network/mac.js
FUNCTION: parse_access_points_list
The parsing of access points fails if the SSID contains a "-" or ":" because of the way it's currently parsed.
specifically line 87:
var start = line.split(/\s[0-9a-f]{2}[:]/); // split on MAC addr start
Cases:
SSID:
dd-wrt
SCAN OUTPUT:
dd-wrt 00:00:00:00:00:00 -35 11 N -- WEP
SSID:
S:H:U:T T:H:E D:O:O:R
SCAN OUTPUT:
S:H:U:T T:H:E D:O:O:R 00:00:00:00:00:00 -35 11 N -- WEP
Proposed Solution
Use the Plist/XML version of the command
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -s --xml
Output is a parsable Plist and there is a library to handle them node-plist
The text was updated successfully, but these errors were encountered: