diff options
author | Jiří Klimeš <jklimes@redhat.com> | 2015-11-10 14:46:57 +0100 |
---|---|---|
committer | Jiří Klimeš <jklimes@redhat.com> | 2015-11-20 10:35:10 +0100 |
commit | 0f6baeef35550e7f151a817fb8e2988ae88198b7 (patch) | |
tree | 598b01603f8f4632a689e7d8be8e7e5855190e7b | |
parent | b41b32cb7b503ae189e53bc410748d08eb7c96ae (diff) | |
download | NetworkManager-0f6baeef35550e7f151a817fb8e2988ae88198b7.tar.gz |
core: verify secrets when adding connection via D-Bus (bgo #757843)
Fixes: dbbedce21f0dbb2849ed48bd2cee3b98e1ad2135
libnm: don't check for valid passwords in NMSetting:verify()
https://bugzilla.gnome.org/show_bug.cgi?id=757843
-rw-r--r-- | src/settings/nm-settings.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/settings/nm-settings.c b/src/settings/nm-settings.c index bdea933249..d742333194 100644 --- a/src/settings/nm-settings.c +++ b/src/settings/nm-settings.c @@ -1407,7 +1407,11 @@ impl_settings_add_connection_helper (NMSettings *self, GError *error = NULL; connection = nm_simple_connection_new_from_dbus (settings, &error); + if (connection) { + if (!nm_connection_verify_secrets (connection, &error)) + goto failure; + nm_settings_add_connection_dbus (self, connection, save_to_disk, @@ -1415,10 +1419,12 @@ impl_settings_add_connection_helper (NMSettings *self, impl_settings_add_connection_add_cb, NULL); g_object_unref (connection); - } else { - g_assert (error); - g_dbus_method_invocation_take_error (context, error); + return; } + +failure: + g_assert (error); + g_dbus_method_invocation_take_error (context, error); } static void |