diff options
author | Dan Williams <dcbw@redhat.com> | 2007-10-04 14:09:59 +0000 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2007-10-04 14:09:59 +0000 |
commit | 68294479032d9f864b35dfbae894b3b428910178 (patch) | |
tree | ac55637fea00a8100b5dcd1b38265f9d1406e862 /libnm-util/nm-setting.c | |
parent | 27a1a0e95ac32008f62dac49bd68406be8106272 (diff) |
2007-10-04 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-setting.c
- (nm_settings_verify): use #defines when possible rather than strings
- (setting_connection_verify): ensure that 'name' and 'type' are valid
- (setting_vpn_verify): tighter validity check on 'service_type'
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2932 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Diffstat (limited to 'libnm-util/nm-setting.c')
-rw-r--r-- | libnm-util/nm-setting.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libnm-util/nm-setting.c b/libnm-util/nm-setting.c index 5e76371c76..73532dc686 100644 --- a/libnm-util/nm-setting.c +++ b/libnm-util/nm-setting.c @@ -34,7 +34,7 @@ nm_settings_verify (GHashTable *all_settings) VerifySettingsInfo info; /* First, make sure there's at least 'connection' setting */ - p = g_hash_table_lookup (all_settings, "connection"); + p = g_hash_table_lookup (all_settings, NM_SETTING_CONNECTION); if (!p) { g_warning ("'connection' setting not present."); return FALSE; @@ -458,6 +458,12 @@ setting_connection_verify (NMSetting *setting, GHashTable *all_settings) { NMSettingConnection *self = (NMSettingConnection *) setting; + if (!self->name || !strlen (self->name)) + return FALSE; + + if (!self->type || !strlen (self->type)) + return FALSE; + /* Make sure the corresponding 'type' item is present */ if (!g_hash_table_lookup (all_settings, self->type)) return FALSE; @@ -1246,7 +1252,7 @@ setting_vpn_verify (NMSetting *setting, GHashTable *all_settings) { NMSettingVPN *self = (NMSettingVPN *) setting; - if (!self->service_type) + if (!self->service_type || !strlen (self->service_type)) return FALSE; return TRUE; |