libnm: fix secret-name parameter in NMSettingClearSecretsWithFlagsFn for VPN

The secret name should be the one that we can pass to nm_setting_get_secret_flags().
It's wrong to call the function repeatedly with secret-name "secrets".

Probably nobody cared anyway about the name. nm_connection_clear_secrets_with_func()
is used to clear secrets based on the flags, not the secret-name.

Fixes: 2b2404bbef
This commit is contained in:
Thomas Haller
2019-01-13 21:34:01 +01:00
parent 3a915a0205
commit d2388250d6

View File

@@ -832,7 +832,7 @@ clear_secrets_with_flags (NMSetting *setting,
NMSettingSecretFlags flags = NM_SETTING_SECRET_FLAG_NONE;
nm_setting_get_secret_flags (setting, secret, &flags, NULL);
if (func (setting, pspec->name, flags, user_data) == TRUE) {
if (func (setting, secret, flags, user_data) == TRUE) {
g_hash_table_iter_remove (&iter);
changed = TRUE;
}