Commit 559ab7bd authored by Thomas Haller's avatar Thomas Haller
Browse files

libnm: accept invalid connections in NMVpnServicePlugin

When we receive a connection from NetworkManager it is not guaranteed
that the connection verifies. For example, if the current libnm version
is older then the NetworkManager version.

Be more accepting and don't do any verification of the connection.

For NMVpnPluginOld this change is uncritical, because there are probably
no users of this API anyway.

NMVpnServicePlugin is new API since nm-1-1. However, this API is already
strongly used by all the plugins we ported over. So this change is
affecting them.
This should only matter if libnm's and NetworkManager's version differ,
because NetworkManager just doesn't send out an invalid connection. It
actually only matters if NetworkManager is a newer version and sends an
invalid connection to the client. That is anyway badly tested and probably
this changes rather improves compatibility than breaking existing users.
parent 9a31bbcb
......@@ -465,7 +465,7 @@ _connect_generic (NMVpnPluginOld *plugin,
return;
}
connection = nm_simple_connection_new_from_dbus (properties, &error);
connection = _nm_simple_connection_new_from_dbus (properties, NM_SETTING_PARSE_FLAGS_BEST_EFFORT, &error);
if (!connection) {
g_dbus_method_invocation_return_error (context,
NM_VPN_PLUGIN_ERROR,
......@@ -547,7 +547,7 @@ impl_vpn_plugin_old_need_secrets (NMVpnPluginOld *plugin,
gboolean needed;
GError *error = NULL;
connection = nm_simple_connection_new_from_dbus (properties, &error);
connection = _nm_simple_connection_new_from_dbus (properties, NM_SETTING_PARSE_FLAGS_BEST_EFFORT, &error);
if (!connection) {
g_dbus_method_invocation_return_error (context,
NM_VPN_PLUGIN_ERROR,
......@@ -606,7 +606,7 @@ impl_vpn_plugin_old_new_secrets (NMVpnPluginOld *plugin,
return;
}
connection = nm_simple_connection_new_from_dbus (properties, &error);
connection = _nm_simple_connection_new_from_dbus (properties, NM_SETTING_PARSE_FLAGS_BEST_EFFORT, &error);
if (!connection) {
g_dbus_method_invocation_return_error (context,
NM_VPN_PLUGIN_ERROR,
......
......@@ -481,7 +481,7 @@ _connect_generic (NMVpnServicePlugin *plugin,
return;
}
connection = nm_simple_connection_new_from_dbus (properties, &error);
connection = _nm_simple_connection_new_from_dbus (properties, NM_SETTING_PARSE_FLAGS_BEST_EFFORT, &error);
if (!connection) {
g_dbus_method_invocation_return_error (context,
NM_VPN_PLUGIN_ERROR,
......@@ -567,7 +567,7 @@ impl_vpn_service_plugin_need_secrets (NMVpnServicePlugin *plugin,
gboolean needed;
GError *error = NULL;
connection = nm_simple_connection_new_from_dbus (properties, &error);
connection = _nm_simple_connection_new_from_dbus (properties, NM_SETTING_PARSE_FLAGS_BEST_EFFORT, &error);
if (!connection) {
g_dbus_method_invocation_return_error (context,
NM_VPN_PLUGIN_ERROR,
......@@ -626,7 +626,7 @@ impl_vpn_service_plugin_new_secrets (NMVpnServicePlugin *plugin,
return;
}
connection = nm_simple_connection_new_from_dbus (properties, &error);
connection = _nm_simple_connection_new_from_dbus (properties, NM_SETTING_PARSE_FLAGS_BEST_EFFORT, &error);
if (!connection) {
g_dbus_method_invocation_return_error (context,
NM_VPN_PLUGIN_ERROR,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment