mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-05 13:28:02 +02:00
settings: remove settings dict from connection 'updated' signal
New connections should not be pushed out in the Updated signal because signals cannot be restricted to particular clients, and some clients may not have permission to view the connection. Upon receiving the Updated signal, clients should re-read the connection using GetSettings to ensure that the client still has permissions to view the connection, and to get the updated settings.
This commit is contained in:
parent
87aa9a1412
commit
9d077444a9
3 changed files with 8 additions and 30 deletions
|
|
@ -43,16 +43,11 @@
|
|||
|
||||
<signal name="Updated">
|
||||
<tp:docstring>
|
||||
Emitted when some settings changed. Updates do include
|
||||
connection permission changes, so clients should check whether
|
||||
they still have permission to access the connection after
|
||||
receiving this signal.
|
||||
Emitted when any settings or permissions change. When handling
|
||||
this signal, clients should re-read the connection using the
|
||||
GetSettings method to get the changes and to ensure the client
|
||||
still has permission to access the connection.
|
||||
</tp:docstring>
|
||||
<arg name="settings" type="a{sa{sv}}" tp:type="String_String_Variant_Map_Map">
|
||||
<tp:docstring>
|
||||
Contains complete connection setting parameters, including changes.
|
||||
</tp:docstring>
|
||||
</arg>
|
||||
</signal>
|
||||
|
||||
<signal name="Removed">
|
||||
|
|
|
|||
|
|
@ -621,9 +621,7 @@ connection_removed (NMSysconfigConnection *obj, gpointer user_data)
|
|||
}
|
||||
|
||||
static void
|
||||
connection_updated (NMSysconfigConnection *connection,
|
||||
GHashTable *settings,
|
||||
gpointer user_data)
|
||||
connection_updated (NMSysconfigConnection *connection, gpointer user_data)
|
||||
{
|
||||
/* Re-emit for listeners like NMPolicy */
|
||||
g_signal_emit (NM_SETTINGS (user_data),
|
||||
|
|
|
|||
|
|
@ -334,28 +334,13 @@ nm_sysconfig_connection_get_secrets (NMSysconfigConnection *connection,
|
|||
|
||||
/**************************************************************/
|
||||
|
||||
static void
|
||||
emit_updated (NMSysconfigConnection *connection)
|
||||
{
|
||||
NMConnection *tmp;
|
||||
GHashTable *settings;
|
||||
|
||||
tmp = nm_connection_duplicate (NM_CONNECTION (connection));
|
||||
nm_connection_clear_secrets (tmp);
|
||||
settings = nm_connection_to_hash (tmp);
|
||||
g_object_unref (tmp);
|
||||
|
||||
g_signal_emit (connection, signals[UPDATED], 0, settings);
|
||||
g_hash_table_destroy (settings);
|
||||
}
|
||||
|
||||
static void
|
||||
commit_changes (NMSysconfigConnection *connection,
|
||||
NMSysconfigConnectionCommitFunc callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
g_object_ref (connection);
|
||||
emit_updated (connection);
|
||||
g_signal_emit (connection, signals[UPDATED], 0);
|
||||
callback (connection, NULL, user_data);
|
||||
g_object_unref (connection);
|
||||
}
|
||||
|
|
@ -950,8 +935,8 @@ nm_sysconfig_connection_class_init (NMSysconfigConnectionClass *class)
|
|||
G_SIGNAL_RUN_FIRST,
|
||||
0,
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__BOXED,
|
||||
G_TYPE_NONE, 1, DBUS_TYPE_G_MAP_OF_MAP_OF_VARIANT);
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
signals[REMOVED] =
|
||||
g_signal_new (NM_SYSCONFIG_CONNECTION_REMOVED,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue