Re: ssid with double space not stored correctly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

Am 13.12.2017 um 13:33 schrieb Dale R. Worley:
> Erich Titl <erich.titl@xxxxxxxx> writes:
>> SALT# wpa_cli set_network 23 ssid \"NOS-CAFE DA  MARINA\"
>> Selected interface 'wlan0'
>> OK
> 
> I'm just a lurker here, but if SSIDs can contain spaces (I never
> realized that!), then *all* the programs have to be hardened to deal
> with spaces in SSIDs correctly.  It's not too difficult if you pay close
> attention, but it's easy to overlook.
> 
> For instance, one "correct" command line would be
> 
> # wpa_cli set_network 23 ssid 'NOS-CAFE DA  MARINA'
> 
> This is also correct:
> 
> # wpa_cli set_network 23 ssid "NOS-CAFE DA  MARINA"
> 
> In both cases, the 4th argument to the wpa_cli program is the string
> "NOS-CAFE DA  MARINA" (19 characters).
> 
> This command:
> 
> # wpa_cli set_network 23 ssid \"NOS-CAFE DA  MARINA\"
> 
> would be expected to produce freaky results, since the 4th argument to
> wpa_cli is the string '"NOS-CAFE' (8 chars), the 5th is 'DA' (2 chars),
> and the 6th is 'MARINA"' (7 chars), since the spaces between the words
> aren't quotes (since the double-quotes are quoted, they do not make a
> quoted tring).
> 
> Where it gets tricky is if one of the programs involved is a shell
> script; then you have to take special care to always quote the SSID when
> it's mentioned.

Exactly and his is the fixed original

$WPA_CLI set_network ssid "\"$1"\"

So that is where the tricky things are hidden

cheers

ET

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap

[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux