mirror of
https://github.com/gryf/wicd.git
synced 2026-02-17 23:45:45 +01:00
Pass lists instead of strings in GeneratePSK and Authenticate methods.
This commit is contained in:
@@ -752,7 +752,7 @@ class BaseWirelessInterface(BaseInterface):
|
|||||||
"""
|
"""
|
||||||
if not self.iface: return False
|
if not self.iface: return False
|
||||||
cmd = ['iwconfig', self.iface, 'essid', essid]
|
cmd = ['iwconfig', self.iface, 'essid', essid]
|
||||||
if channel:
|
if channel and str(channel).isdigit():
|
||||||
cmd.extend(['channel', str(channel)])
|
cmd.extend(['channel', str(channel)])
|
||||||
if bssid:
|
if bssid:
|
||||||
cmd.extend(['ap', bssid])
|
cmd.extend(['ap', bssid])
|
||||||
@@ -770,7 +770,8 @@ class BaseWirelessInterface(BaseInterface):
|
|||||||
if not wpa_pass_path: return None
|
if not wpa_pass_path: return None
|
||||||
key_pattern = re.compile('network={.*?\spsk=(.*?)\n}.*',
|
key_pattern = re.compile('network={.*?\spsk=(.*?)\n}.*',
|
||||||
re.I | re.M | re.S)
|
re.I | re.M | re.S)
|
||||||
cmd = ' '.join([wpa_pass_path, network['essid'], network['key']])
|
cmd = [wpa_pass_path, network['essid'], network['key']]
|
||||||
|
if self.verbose: print cmd
|
||||||
return misc.RunRegex(key_pattern, misc.Run(cmd))
|
return misc.RunRegex(key_pattern, misc.Run(cmd))
|
||||||
|
|
||||||
def Authenticate(self, network):
|
def Authenticate(self, network):
|
||||||
@@ -784,9 +785,10 @@ class BaseWirelessInterface(BaseInterface):
|
|||||||
if self.wpa_driver == RALINK_DRIVER:
|
if self.wpa_driver == RALINK_DRIVER:
|
||||||
self._AuthenticateRalinkLegacy(network)
|
self._AuthenticateRalinkLegacy(network)
|
||||||
else:
|
else:
|
||||||
cmd = ''.join(['wpa_supplicant -B -i ', self.iface, ' -c ',
|
cmd = ['wpa_supplicant', '-B', '-i', self.iface, '-c',
|
||||||
wpath.networks, network['bssid'].replace(':','').lower(),
|
os.path.join(wpath.networks,
|
||||||
' -D ', self.wpa_driver])
|
network['bssid'].replace(':', '').lower()),
|
||||||
|
'-D', self.wpa_driver]
|
||||||
if self.verbose: print cmd
|
if self.verbose: print cmd
|
||||||
misc.Run(cmd)
|
misc.Run(cmd)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user