After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 623316 - Prompt user for system connection secrets
Prompt user for system connection secrets
Status: RESOLVED OBSOLETE
Product: NetworkManager
Classification: Platform
Component: general
0.8.x
Other Linux
: Normal enhancement
: ---
Assigned To: Dan Williams
NetworkManager maintainer(s)
Depends on:
Blocks: nm-patch
 
 
Reported: 2010-07-01 19:13 UTC by Michael Terry
Modified: 2020-11-12 14:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Adds DBus API for daemon to use (18.77 KB, patch)
2010-07-01 19:16 UTC, Michael Terry
none Details | Review
Handles the new call in nm-applet (19.17 KB, patch)
2010-07-01 19:16 UTC, Michael Terry
none Details | Review
updated get secrets for connection D-Bus call patch (19.38 KB, patch)
2010-07-02 06:35 UTC, Dan Williams
none Details | Review
updated nm-applet patch (20.71 KB, patch)
2010-09-24 18:15 UTC, Michael Terry
none Details | Review

Description Michael Terry 2010-07-01 19:13:04 UTC
System connections have no mechanisms for prompting if a password is no longer correct or not provided. They should!

I believe this will require DBus API changes to network-manager and changes to use the new API in network-manager-applet. I have a patch attached, but they may need some work.

The first patch adds a new DBus interface for the NetworkManager daemon to call to get secrets (org.freedesktop.NetworkManagerSettings.Secrets).

The second patch is to nm-applet to implement the interface and actually throw up the dialog.  Not much work there, it just handles the DBus call and removes a lot of checks that were there to prevent that situation before.  :)
Comment 1 Michael Terry 2010-07-01 19:16:01 UTC
Created attachment 165046 [details] [review]
Adds DBus API for daemon to use
Comment 2 Michael Terry 2010-07-01 19:16:30 UTC
Created attachment 165047 [details] [review]
Handles the new call in nm-applet
Comment 3 Michael Terry 2010-07-01 19:20:35 UTC
One thing my patches do not do, and they *should* is to not ask a non-privileged user for a password.  Like, if they don't belong to the admin group or something.  Right now, it gives every user the ability to change the system connection secrets, which is probably not desirable.  I'm not currently working on that though.
Comment 4 Dan Williams 2010-07-02 06:34:40 UTC
It looks pretty good from 5,000ft; a few comments...  First, we probably want a 'service_name' argument in the D-Bus call (and down the chain into the settings service interface and base class) to maintain consistency with various other calls like ActivateConnection; the only reason that the other GetSecrets call didn't require this argument was that it was a call on the Connection object, and thus we already knew what settings service provided it.  In this case we really don't.

Second, in git master we have an authentication framework we can use.  The NMManager object has the 'user_net_perm' variable that we can use for this purpose. We should check that it is NM_AUTH_CALL_RESULT_YES and if so, we can ask the user for secrets. This implies that the system administrator has allowed this user to control networking at all.  This is also the gate for the "Enable Networking" checkbox in the applet these days.

This isn't perhaps as fine-grained as I'd like, but I'm not sure we want to request PolicyKit authorization right before we ask the user for the wifi password either.  There are probably cases where admins want the user to be able to start/stop system connections (ie, allow network control) but not change them.  That would require a new permission though, which we could implement fairly easily but obviously is more code.

We need to keep binary compat as well; which means we can't re-arrange members in the public structures like in libnm-glib/nm-settings-interface.h; you had inserted the new member between two existing ones; we need it at the end.

Likewise for symbol visibility we need to ensure that new functions like nm_settings_interface_get_secrets_for_connection() get added to libnm-glib.ver so they are actually usable.

Can you test my attached patch out and update the applet patch to match the new D-Bus arguments?  Thanks!
Comment 5 Dan Williams 2010-07-02 06:35:29 UTC
Created attachment 165071 [details] [review]
updated get secrets for connection D-Bus call patch
Comment 6 Dan Williams 2010-07-16 20:10:02 UTC
Note there is on error in my patch where info->connection isnt' getting set; so keep that in mind when testing that out.  Let me know!
Comment 7 Michael Terry 2010-07-19 16:23:58 UTC
Just a quick update to say I haven't entirely forgotten about this bug.  I will help test your patch, just have been busy/forgetful.
Comment 8 Michael Terry 2010-09-24 18:15:53 UTC
Created attachment 171053 [details] [review]
updated nm-applet patch

Here's (finally) an updated version of the nm-applet patch built against your new API (which passes the session_name).

It seems to work with two caveats:
1) The password prompt appears with a second password prompt to authorize the user to see the existing password.  Kinda hoky.

2) It seems like it didn't always remember the password I gave it?  Part of my testing was to screw up the password in /etc/NetworkManager/system-connections/* and restart NM, then try.  I could connect alright after the prompt, but if I switched away and back, sometimes it would still prompt me.  Seemed to remember it after a reboot though?
Comment 9 Tobias Mueller 2011-02-13 00:54:47 UTC
reopening as there is a new version of the patch
Comment 10 Thomas Haller 2016-09-07 11:58:47 UTC
this bug would require reworking, and it's not clear that it
Comment 11 Thomas Haller 2016-09-07 12:00:46 UTC
(In reply to Thomas Haller from comment #10)
> this bug would require reworking, and it's not clear that it

*hump*. I meant to say, the patch needs review and reconsideration. Which apparently didn't happen for the past 6 years :(

Is this still relevant?
Comment 12 André Klapper 2020-11-12 14:33:21 UTC
bugzilla.gnome.org is being shut down in favor of a GitLab instance. 
We are closing all old bug reports and feature requests in GNOME Bugzilla which have not seen updates for a long time.

If you still use NetworkManager and if you still see this bug / want this feature in a recent and supported version of NetworkManager, then please feel free to report it at https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/

Thank you for creating this report and we are sorry it could not be implemented (workforce and time is unfortunately limited).