mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-07 05:10:36 +01:00
vpn: ensure secrets requests fail when exhausted
If the plugin says the user-provided secrets are insufficient, make sure we fail instead of potentially overrunning the secrets counter (which triggered an assert).
This commit is contained in:
parent
4938996973
commit
7a6baa8ab4
1 changed files with 12 additions and 4 deletions
|
|
@ -1357,11 +1357,19 @@ plugin_need_secrets_cb (DBusGProxy *proxy,
|
|||
|
||||
if (setting_name && strlen (setting_name)) {
|
||||
/* More secrets required */
|
||||
nm_log_dbg (LOGD_VPN, "(%s/%s) service indicated additional secrets required",
|
||||
nm_connection_get_uuid (priv->connection),
|
||||
nm_connection_get_id (priv->connection));
|
||||
|
||||
get_secrets (self, priv->secrets_idx + 1);
|
||||
if (priv->secrets_idx == SECRETS_REQ_NEW) {
|
||||
nm_log_err (LOGD_VPN, "(%s/%s) final secrets request failed to provide sufficient secrets",
|
||||
nm_connection_get_uuid (priv->connection),
|
||||
nm_connection_get_id (priv->connection));
|
||||
nm_vpn_connection_fail (self, NM_VPN_CONNECTION_STATE_REASON_NO_SECRETS);
|
||||
} else {
|
||||
nm_log_dbg (LOGD_VPN, "(%s/%s) service indicated additional secrets required",
|
||||
nm_connection_get_uuid (priv->connection),
|
||||
nm_connection_get_id (priv->connection));
|
||||
|
||||
get_secrets (self, priv->secrets_idx + 1);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue