GNOME Bugzilla – Bug 775769
'Store the password only for this user' has no effect when choosen in initial connection prompt
Last modified: 2016-12-16 13:52:04 UTC
Created attachment 341578 [details] Screen shots and commenting text documenting the bug. When initially connecting to a wireless network (clicking nm-applet tray icon > click desired network/ssid > a popup window appears asking for a password/phrase) you can choose to "Store the password only for this user" to store the password in the Gnome Keyring, but it has no effect. The password is still stored in plain text in /etc/NetworkManager/system-connections/, and no entry appears in the default keyring. To actually get rid of the plain text entry and have an entry appear in the default keyring you must go to edit the connection, go to "Wi-Fi Security"-tab, and change it again (using the little person shaped icon on the righthand side of the password field). Attach screenshots showing GUI interaction and verification. Tested with NM 1.2.x on Ubuntu 16, don't know the Ubuntu nm-applet version. Tested with NM 1.2.2 and nm-applet 1.2.2 on Arch. Tested with NM 1.4.2 and nm-applet 1.4.2 on Arch. Tested with latest git version, NM 1.5.2 and nm-applet 1.4.3 on Arch. All with the same result.
thanks for the detailed investigation. Looking at https://git.gnome.org/browse/network-manager-applet/tree/src/wireless-security/ws-wpa-psk.c?id=bad04d4cd01b4742243cff0b1cc291b892303a5e#n137 , it seems to be intentional that when being asked for the password (contrary to when editing the connection), you cannot change the storage flag. The bug here is, that you can click on the icon and allows you to select a different password location: https://git.gnome.org/browse/network-manager-applet/tree/src/libnma/nma-ui-utils.c?id=bad04d4cd01b4742243cff0b1cc291b892303a5e#n87
proposed fix: https://git.gnome.org/browse/network-manager-applet/log/?h=th/password-storage-in-ask-mode-bgo775769
I agree the GUI should be fixed iff the flag (all users vs. only this user) can not be changed when asking for the password. I do however think it would be better to offer the choice of storage upon first connection. Chances are you forget to go edit the setting later, and even if you do, the password has already been available in clear text in /etc/NetworkManager/system-connections/. Is that inherently impossible, or just a choice the dev team has made?
It's not possible, as the NetworkManager API through which it requests secrets doesn't allow to change connection properties (like the password location). Theoretically, it would be possible to extend NM's API there, but that would be a large effort.
Thank you for your quick reply (also previous replies). I see, but find it a weird API choice. Do you know if it is possible to change NM's default behaviour (root readable clear text) through configurations (e.g. make it store all new connections in the keyring), or is it hard coded into the applciation? My reason for reporting what I thought was a bug was to be able to choose the right storage method right away.
(In reply to Jonas Camillus Jeppesen from comment #5) > Do you know if it is possible to change NM's default behaviour (root > readable clear text) through configurations (e.g. make it store all new > connections in the keyring), or is it hard coded into the applciation? The connection is created by the client application, not by NetworkManager itself. ... of course, clients like nmcli, nmtui, nm-connection-editor, nm-applet are part of the NetworkManager project, so... it's possible. The use of the keyring/wallet is implemented by clients individually. For example, nmcli doesn't support that, it can only prompt for passwords. Thus, currently "agent-owned" wouldn't make sense for nmcli. It depends on the client
UI fix merged to upstream master: https://git.gnome.org/browse/network-manager-applet/commit/?id=5018f91499f0bae365c9b69f5be5435e46a92627 (it only disables the popup-menu in the password-request-dialog, so that the user cannot select a different password-storage)