Settings empty username for NMSettingGsm not working because of (priv->username && !strlen (priv->username)) in nm-setting-gsm.c



Hi,

i try to set an empty username with:

...
s_gsm = (NMSettingGsm *) nm_setting_gsm_new();
g_object_set (G_OBJECT (s_gsm), NM_SETTING_GSM_USERNAME, "", NULL);
nm_connection_add_setting (connection, NM_SETTING (s_gsm));
GHashTable *hash;
hash = nm_connection_to_hash(connection);
GError* error = NULL;
bus_g_proxy_call (proxy, "AddConnection", &error,
                  DBUS_TYPE_G_MAP_OF_MAP_OF_VARIANT, hash,
                  G_TYPE_INVALID);
if(error != NULL)
{
g_warning("Error ModemGSM: %s", error->message);
g_error_free(error);
}
...

But the Error message is:  Error ModemGSM: username


in libnm-util/nm-setting-gsm.c :
if (priv->username && !strlen (priv->username)) {
g_set_error (error,
            NM_SETTING_GSM_ERROR,
            NM_SETTING_GSM_ERROR_INVALID_PROPERTY,
            NM_SETTING_GSM_USERNAME);
return FALSE;
}


Why must strlen(username) > 0 ? There s no reason for that. Empty usernames should be possible.


Cheers,
Tom



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]