ssid with double space not stored correctly
Erich Titl
erich.titl at think.ch
Wed Dec 13 07:30:56 PST 2017
Hi
Am 13.12.2017 um 13:33 schrieb Dale R. Worley:
> Erich Titl <erich.titl at think.ch> 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
-------------- 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/20171213/f79d7495/attachment.p7s>
More information about the Hostap
mailing list