* wifi: pass discovered SSIDs to nmcli without a shell
The nmcli scan path interpolated each nearby SSID into a system()
command. A nearby access point could execute commands as the
RetroArch user when the Wi-Fi network list was opened.
Query saved profiles and connect or disconnect using argument-based
nmcli calls, so SSIDs and passphrases remain literal arguments.
* wifi/nmcli: fill the nmcli argument vectors by assignment
C89 takes only constant expressions in an aggregate initializer, and the
argument vectors held the SSID and passphrase: the C89 lane rejected all
five. The vectors are now declared and filled in by assignment.
---------
Co-authored-by: libretroadmin <[email protected]>
- Use the password stored in the connection profile instead of asking
each time to the user
- `Disconnect` menu item wasn't shown even when connected
When entering the Wi-Fi menu first, `nmcli_connection_info` is called with
`NULL`. If we return `false` here, the menu doesn't show the `Disconnect`
menu item even when the wifi is on and connected.
- Don't consider wired connections when checking if the device is connected
`cmd_file = popen("nmcli -f NAME c show --active | tail -n+2", "r");`
That command returns all active connections, even the wired ones. That
means that if the wifi is not connected but we have a wired connection,
retroarch shows the Disconnect menu item to disconnect ... a
non-existent wifi connection.