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
This commit is contained in:
Dan Williams 2007-10-04 14:09:59 +00:00
parent 27a1a0e95a
commit 6829447903
2 changed files with 15 additions and 2 deletions

View file

@ -1,3 +1,10 @@
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'
2007-10-04 Dan Williams <dcbw@redhat.com>
* libnm-glib/nm-settings.c

View file

@ -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;