diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2019-02-02 15:19:21 +0100 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2019-02-05 10:20:30 +0100 |
commit | ca58bcca0c3cfc6ae44f4a6c7c227590405e6d7c (patch) | |
tree | 1d8deba05c56e70f24f2057c219af28086f8ecb2 | |
parent | fab1116494d096d96218ac48f51cbc967345703c (diff) | |
download | NetworkManager-lr/sae.tar.gz |
cli: verify connections before sending them over to daemonlr/sae
This way we generate the error messages on the client side and therefore
can localize them.
-rw-r--r-- | clients/cli/connections.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/clients/cli/connections.c b/clients/cli/connections.c index b8fac54e5c..8781e902c3 100644 --- a/clients/cli/connections.c +++ b/clients/cli/connections.c @@ -4834,6 +4834,17 @@ add_new_connection (gboolean persistent, GAsyncReadyCallback callback, gpointer user_data) { + GError *error = NULL; + + if ( !nm_connection_verify (connection, &error) + || !nm_connection_verify_secrets (connection, &error)) { + g_simple_async_report_take_gerror_in_idle (G_OBJECT (client), + callback, + user_data, + error); + return; + } + nm_client_add_connection_async (client, connection, persistent, NULL, callback, user_data); } @@ -4844,6 +4855,18 @@ update_connection (gboolean persistent, GAsyncReadyCallback callback, gpointer user_data) { + GError *error = NULL; + + if ( !nm_connection_verify (NM_CONNECTION (connection), &error) + || !nm_connection_verify_secrets (NM_CONNECTION (connection), &error)) { + g_simple_async_report_take_gerror_in_idle (G_OBJECT (connection), + callback, + user_data, + error); + return; + } + + nm_remote_connection_commit_changes_async (connection, persistent, NULL, callback, user_data); } |