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 761714 - [RFE] make changes to applied connection (Reapply) atomic
[RFE] make changes to applied connection (Reapply) atomic
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks: nm-1-2
 
 
Reported: 2016-02-08 13:42 UTC by Thomas Haller
Modified: 2016-02-16 10:35 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Thomas Haller 2016-02-08 13:42:54 UTC
Reapply() (bug 697370) and GetAppliedConnection() (bug 760884) should expose an ~transaction id~ and reject reapply if the id changed in the meantime.
Comment 1 Thomas Haller 2016-02-11 11:51:17 UTC
Branch on review. See bug 760884
Comment 2 Beniamino Galvani 2016-02-11 13:29:42 UTC
> core: add transaction-id to NMActiveConnection

I find that version_id would be a more appropriate name, since it's a
value that identifies a given version of the object, even if no
transaction has happened (for example, for new constructed
objects). But no strong opinion about this.

Also, can you shortly explain in the commit message what is the
purpose of this new field?

>  all: add transaction-id to device's Reapply method

 /**
  * nm_device_reapply_async:
  * @device: a #NMDevice
  * @connection: the #NMConnection to replace the applied settings with or %NULL to reuse existing
+ * @transaction_id: zero or a the current transaction id of the applied connection

s/or a the/or the/ (the same also in nm_device_reapply())

> core: add NMDevice's GetAppliedConnection D-Bus call

+      <tp:docstring>
+        The currently applied connection on the device. This is a snapshot of the last activated

s/The currently/Get the currently/

+static void
+impl_device_get_appied_connection (NMDevice *self,
+                                   GDBusMethodInvocation *context)

s/appied/applied/

+{
+       g_return_if_fail (NM_IS_DEVICE (self));
+
+       /* Ask the manager to authenticate this request for us */
+       g_signal_emit (self, signals[AUTH_REQUEST], 0,
+                      context,
+                      nm_device_get_applied_connection (self),
+                      NM_AUTH_PERMISSION_NETWORK_CONTROL,

Is there any reason why getting the current applied settings requires
some permissions? Probably this should be available to everyone...
Comment 3 Thomas Haller 2016-02-11 14:27:47 UTC
(In reply to Beniamino Galvani from comment #2)

> +       /* Ask the manager to authenticate this request for us */
> +       g_signal_emit (self, signals[AUTH_REQUEST], 0,
> +                      context,
> +                      nm_device_get_applied_connection (self),
> +                      NM_AUTH_PERMISSION_NETWORK_CONTROL,
> 
> Is there any reason why getting the current applied settings requires
> some permissions? Probably this should be available to everyone...

maybe. But AUTH_REQUEST signal handler in NMManager requires permissions to be requested and the argument cannot be omitted. So this would need some refactoring.

The main use of this is to work together with Reapply(), so a user who can use Reapply() also has permissions for GetAppliedConnection(). Not sure what we want here, but for now to be more strict seems acceptable.


Fixed the rest