ssid with double space not stored correctly

Erich Titl erich.titl at think.ch
Mon Dec 11 06:38:13 PST 2017


Hi Jouni

Am 11.12.2017 um 11:15 schrieb Jouni Malinen:
> On Sun, Dec 10, 2017 at 05:56:29PM +0100, Erich Titl wrote:
>> I am running wpa_supplicant 2.6 on an embedded linux platform. It
>> appears that ssid's with double white space is not correctly written to
>> wpa_supplicant using wpa_cli
>>
>> SALT# wpa_cli set_network 23 ssid \"NOS-CAFE DA  MARINA\"
> 
> Please note that this gets processed by the shell and since the full
> SSID value was not quoted, the shell will parse this in a way that
> removes duplicated whitespace between the command line arguments.

Yes, but

SALT# wpa_cli set_network 23 ssid "NOS-CAFE DA  MARINA"
Selected interface 'wlan0'
FAIL
SALT# wpa_cli set_network 23 ssid \"NOS-CAFE DA  MARINA\"
Selected interface 'wlan0'
OK

This is slightly different from the echo example, echo accepts single
quotes where wpa_cli appears to react differently.

cheers

ET


> 
>> It feels like double spaces are somehow suppressed in wpa_cli
> 
> wpa_cli does not do this, the shell command line parsing does.. You'll
> get the exact same behavior with other programs like echo:
> 
> $ echo \"NOS-CAFE DA  MARINA\"
> "NOS-CAFE DA MARINA"
> 
> $ echo '"NOS-CAFE DA  MARINA"'
> "NOS-CAFE DA  MARINA"
> 
> 
> wpa_cli does try to parse together the value from multiple command line
> arguments, but it does not get knowledge of what kind of whitespace was
> used between them, so it cannot build the correct value in some cases.
> Providing the full value as a single command line argument (like that
> second echo example above) is a more robust way of doing this.
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1928 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.infradead.org/pipermail/hostap/attachments/20171211/bce01c72/attachment.p7s>


More information about the Hostap mailing list