[network-manager-openvpn/NETWORKMANAGER_0_7] core: ensure clear error argument during validation (bgo #597593)
- From: Dan Williams <dcbw src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [network-manager-openvpn/NETWORKMANAGER_0_7] core: ensure clear error argument during validation (bgo #597593)
- Date: Wed, 7 Oct 2009 16:07:10 +0000 (UTC)
commit 16b3a46599f4f418b6a92a18bc0692c679a08caf
Author: Dan Williams <dcbw redhat com>
Date: Tue Oct 6 16:42:15 2009 -0700
core: ensure clear error argument during validation (bgo #597593)
src/nm-openvpn-service.c | 18 ++++++++++++++----
1 files changed, 14 insertions(+), 4 deletions(-)
---
diff --git a/src/nm-openvpn-service.c b/src/nm-openvpn-service.c
index 4b45b32..857d539 100644
--- a/src/nm-openvpn-service.c
+++ b/src/nm-openvpn-service.c
@@ -213,7 +213,8 @@ validate_one_property (const char *key, const char *value, gpointer user_data)
static gboolean
nm_openvpn_properties_validate (NMSettingVPN *s_vpn, GError **error)
{
- ValidateInfo info = { &valid_properties[0], error, FALSE };
+ GError *validate_error = NULL;
+ ValidateInfo info = { &valid_properties[0], &validate_error, FALSE };
nm_setting_vpn_foreach_data_item (s_vpn, validate_one_property, &info);
if (!info.have_items) {
@@ -225,13 +226,18 @@ nm_openvpn_properties_validate (NMSettingVPN *s_vpn, GError **error)
return FALSE;
}
- return *error ? FALSE : TRUE;
+ if (validate_error) {
+ *error = validate_error;
+ return FALSE;
+ }
+ return TRUE;
}
static gboolean
nm_openvpn_secrets_validate (NMSettingVPN *s_vpn, GError **error)
{
- ValidateInfo info = { &valid_secrets[0], error, FALSE };
+ GError *validate_error = NULL;
+ ValidateInfo info = { &valid_secrets[0], &validate_error, FALSE };
nm_setting_vpn_foreach_secret (s_vpn, validate_one_property, &info);
if (!info.have_items) {
@@ -243,7 +249,11 @@ nm_openvpn_secrets_validate (NMSettingVPN *s_vpn, GError **error)
return FALSE;
}
- return *error ? FALSE : TRUE;
+ if (validate_error) {
+ *error = validate_error;
+ return FALSE;
+ }
+ return TRUE;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]