1
0
mirror of https://github.com/gryf/wicd.git synced 2025-12-19 12:28:08 +01:00

Don't support wireless networks with '\x00' in the ESSID

This commit is contained in:
David Paleino
2011-12-29 12:16:17 +01:00
parent 68b8d84231
commit 8aa66e4974
5 changed files with 33 additions and 2 deletions

View File

@@ -158,6 +158,9 @@ if options.network_property:
if not options.set_to:
print wireless.GetWirelessProperty(network_id, options.network_property)
else:
if '<NULL>' in wireless.GetWirelessProperty(network_id, 'essid'):
print 'ERROR: networks with NULL bytes are not supported.'
sys.exit(2)
wireless.SetWirelessProperty(network_id, \
options.network_property, options.set_to)
elif options.wired:
@@ -184,6 +187,9 @@ if options.connect:
is_valid_wireless_network_id(options.network)
name = wireless.GetWirelessProperty(options.network, 'essid')
encryption = wireless.GetWirelessProperty(options.network, 'enctype')
if '<NULL>' in name:
print 'ERROR: networks with NULL bytes are not supported.'
sys.exit(2)
print "Connecting to %s with %s on %s" % (name, encryption,
wireless.DetectWirelessInterface())
wireless.ConnectWireless(options.network)
@@ -242,6 +248,10 @@ if options.wireless and options.list_encryption_types:
if options.save and options.network > -1:
if options.wireless:
is_valid_wireless_network_id(options.network)
essid = wireless.GetWirelessProperty(options.network, 'essid')
if '<NULL>' in essid:
print 'ERROR: networks with NULL bytes are not supported.'
sys.exit(2)
config.SaveWirelessNetworkProfile(options.network)
elif options.wired:
config.SaveWiredNetworkProfile(options.name)