Commit Graph
6 Commits
Author SHA1 Message Date
Acts1631andlibretroadmin 8e0f4ae0ac nmcli: avoid shell execution from nearby SSIDs (#19646)
* 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]>
2026-10-01 05:32:26 +02:00
jecaro 3637f49ddc Fix nmcli wifi driver
- 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.
2025-05-05 12:38:12 +02:00
libretroadmin 99c7e08445 Don't use string_trim_whitespace 2024-12-23 00:51:01 +01:00
libretroadmin 05622ebe85 Some trivial strlen usage simplifications where possible, removing
the need for strlen
2022-07-20 17:23:28 +02:00
twinaphex bfeffb2423 Fix local header path includes 2021-12-04 16:11:02 +01:00
Autechre 71b30d7846 Split up wifi networking code - move it into separate file (#13262) 2021-11-21 12:37:39 +01:00