diff options
author | Thomas Haller <thaller@redhat.com> | 2016-03-26 13:18:30 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2016-03-29 11:56:27 +0200 |
commit | fbb1662269e3c47fa51abfe37d1f3c8f0a213bd0 (patch) | |
tree | a702b29f1e6dfc4e6a2ba4bb85ecc0fb39dd9834 /libnm-glib | |
parent | 9bf3933855f6c9ccd65447e73a59e24055a6e340 (diff) |
libnm-glib: don't fail creating connection in NMSecretAgent
The connection should be created best-effort. If the connection doesn't
validate, the connection request still can be answered by the agent.
Diffstat (limited to 'libnm-glib')
-rw-r--r-- | libnm-glib/nm-secret-agent.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/libnm-glib/nm-secret-agent.c b/libnm-glib/nm-secret-agent.c index 0a8624556..03290469a 100644 --- a/libnm-glib/nm-secret-agent.c +++ b/libnm-glib/nm-secret-agent.c @@ -27,6 +27,7 @@ #include "nm-secret-agent.h" #include "nm-glib-enum-types.h" #include "nm-dbus-helpers-private.h" +#include "nm-setting-private.h" static void impl_secret_agent_get_secrets (NMSecretAgent *self, GHashTable *connection_hash, @@ -302,7 +303,8 @@ verify_request (NMSecretAgent *self, GError **error) { NMConnection *connection = NULL; - GError *local = NULL; + + g_return_val_if_fail (out_connection, FALSE); if (!verify_sender (self, context, error)) return FALSE; @@ -321,21 +323,11 @@ verify_request (NMSecretAgent *self, } /* Make sure the given connection is valid */ - g_assert (out_connection); - connection = nm_connection_new_from_hash (connection_hash, &local); - if (connection) { - nm_connection_set_path (connection, connection_path); - *out_connection = connection; - } else { - g_set_error (error, - NM_SECRET_AGENT_ERROR, - NM_SECRET_AGENT_ERROR_INVALID_CONNECTION, - "Invalid connection: %s", - local->message); - g_clear_error (&local); - } + connection = _nm_connection_new_from_hash (connection_hash); + nm_connection_set_path (connection, connection_path); + *out_connection = connection; - return !!connection; + return TRUE; } static void |