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:
10
NEWS
10
NEWS
@@ -1,4 +1,12 @@
|
|||||||
Wicd 1.7.0 Branch
|
Wicd 1.7 Series
|
||||||
|
---------------
|
||||||
|
|
||||||
|
1.7.1
|
||||||
|
Major Changes:
|
||||||
|
- Wireless networks with NULL bytes ('\x00') in the ESSID are not
|
||||||
|
supported. They will still show up in the UIs, but you won't be able
|
||||||
|
to do anything with them.
|
||||||
|
|
||||||
1.7.1b2:
|
1.7.1b2:
|
||||||
Changes for Packagers:
|
Changes for Packagers:
|
||||||
- You will now want to use the --python option to setup.py configure to
|
- You will now want to use the --python option to setup.py configure to
|
||||||
|
|||||||
@@ -158,6 +158,9 @@ if options.network_property:
|
|||||||
if not options.set_to:
|
if not options.set_to:
|
||||||
print wireless.GetWirelessProperty(network_id, options.network_property)
|
print wireless.GetWirelessProperty(network_id, options.network_property)
|
||||||
else:
|
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, \
|
wireless.SetWirelessProperty(network_id, \
|
||||||
options.network_property, options.set_to)
|
options.network_property, options.set_to)
|
||||||
elif options.wired:
|
elif options.wired:
|
||||||
@@ -184,6 +187,9 @@ if options.connect:
|
|||||||
is_valid_wireless_network_id(options.network)
|
is_valid_wireless_network_id(options.network)
|
||||||
name = wireless.GetWirelessProperty(options.network, 'essid')
|
name = wireless.GetWirelessProperty(options.network, 'essid')
|
||||||
encryption = wireless.GetWirelessProperty(options.network, 'enctype')
|
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,
|
print "Connecting to %s with %s on %s" % (name, encryption,
|
||||||
wireless.DetectWirelessInterface())
|
wireless.DetectWirelessInterface())
|
||||||
wireless.ConnectWireless(options.network)
|
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.save and options.network > -1:
|
||||||
if options.wireless:
|
if options.wireless:
|
||||||
is_valid_wireless_network_id(options.network)
|
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)
|
config.SaveWirelessNetworkProfile(options.network)
|
||||||
elif options.wired:
|
elif options.wired:
|
||||||
config.SaveWiredNetworkProfile(options.name)
|
config.SaveWiredNetworkProfile(options.name)
|
||||||
|
|||||||
@@ -364,6 +364,9 @@ class NetLabel(urwid.WidgetWrap):
|
|||||||
|
|
||||||
self.__super.__init__(w)
|
self.__super.__init__(w)
|
||||||
def selectable(self):
|
def selectable(self):
|
||||||
|
# Disable widget if the ESSID contains one (or more) NULL byte
|
||||||
|
if '<NULL>' in self.essid:
|
||||||
|
return False
|
||||||
return True
|
return True
|
||||||
def keypress(self,size,key):
|
def keypress(self,size,key):
|
||||||
return self._w.keypress(size,key)
|
return self._w.keypress(size,key)
|
||||||
|
|||||||
@@ -861,7 +861,11 @@ class WirelessNetworkEntry(NetworkEntry):
|
|||||||
self.show_all()
|
self.show_all()
|
||||||
self.advanced_dialog = WirelessSettingsDialog(networkID)
|
self.advanced_dialog = WirelessSettingsDialog(networkID)
|
||||||
self.wifides = self.connect("destroy", self.destroy_called)
|
self.wifides = self.connect("destroy", self.destroy_called)
|
||||||
|
|
||||||
|
# Disable widget if the ESSID contains one (or more) NULL byte
|
||||||
|
if '<NULL>' in self.essid:
|
||||||
|
self.set_sensitive(False)
|
||||||
|
|
||||||
def _escape(self, val):
|
def _escape(self, val):
|
||||||
""" Escapes special characters so they're displayed correctly. """
|
""" Escapes special characters so they're displayed correctly. """
|
||||||
return val.replace("&", "&").replace("<", "<").\
|
return val.replace("&", "&").replace("<", "<").\
|
||||||
|
|||||||
@@ -1251,6 +1251,12 @@ class BaseWirelessInterface(BaseInterface):
|
|||||||
except (UnicodeDecodeError, UnicodeEncodeError):
|
except (UnicodeDecodeError, UnicodeEncodeError):
|
||||||
print 'Unicode problem with current network essid, ignoring!!'
|
print 'Unicode problem with current network essid, ignoring!!'
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
# We (well, DBus) don't support ESSIDs with null bytes in it.
|
||||||
|
# Substitute the byte for use everywhere, so that the UIs know
|
||||||
|
# what to disable.
|
||||||
|
ap['essid'].replace('\x00', '<NULL>')
|
||||||
|
|
||||||
if ap['essid'] in ['Hidden', '<hidden>', "", None]:
|
if ap['essid'] in ['Hidden', '<hidden>', "", None]:
|
||||||
print 'hidden'
|
print 'hidden'
|
||||||
ap['hidden'] = True
|
ap['hidden'] = True
|
||||||
|
|||||||
Reference in New Issue
Block a user