Comment 20 for bug 388116

Revision history for this message
Matheus Gaudencio (matheusgr) wrote :

I also had the same problem as Wiktor. While trying to connect to a hidden network, the essid is set to \x00\x00 (Debian Wicd 1.7.0-2).

At wnettools.py the only way to detect if a essid is hidden, is testing if it receives a name as "Hidden", "<hidden>" or "":

       if ap['essid'] in ['Hidden', '<hidden>', "", None]:
           print 'hidden'
           ap['hidden'] = True
           ap['essid'] = "<hidden>"
       else:
           ap['hidden'] = False

But when I do a scanning for a hidden network, the essid is set to the desired network essid (wnettools.py SetEssid). Wpa_supplicant will use this essid and will return the hidden network essid when wnettools parses the wpa_supplicant stdout. So the ap['hidden'] is again set to False.

At wicd-daemon.py, ReadWirelessNetworkProfile(self, id) function, I explicitly set the hidden option to be the same as defined previously at the config file:

Original:

       for option in ['use_static_dns', 'use_global_dns', 'encryption',
                      'use_settings_globally']:
           cur_network[option] = bool(cur_network.get(option))
       # Read the essid because we need to name those hidden
       # wireless networks now - but only read it if it is hidden.
       if cur_network["hidden"]:

New:

       for option in ['use_static_dns', 'use_global_dns', 'encryption',
                      'use_settings_globally']:
           cur_network[option] = bool(cur_network.get(option))
       cur_network["hidden"] = bool(self.config.get(section, 'hidden'))
       # Read the essid because we need to name those hidden
       # wireless networks now - but only read it if it is hidden.
       if cur_network["hidden"]:

(sry, to lazy to do a patch)

This may not be the best solution, but since the scan doesn't know about the wireless configuration... Its the best way that I could find to keep the "hidden" configuration. By doing this, the hidden config remains True, and the configured ESSID is kept (no more \x00 for me).