[PATCH] vpn: don't fail if no system secrets exist

The VPN connection requests secrets a few times; first it retrieves
only system-owned secrets to see if they are sufficient (and thus
doesn't need to bother the user), then it retrieves existing agent
owned secrets (so the user doesn't get a popup), then finally if
those aren't sufficient it asks the user interactively.

But if there was some error retrieving system secrets, or if there
weren't any system secrets at all, don't fail the VPN connection.
Just go on and ask the user for the secrets.
 src/vpn-manager/nm-vpn-connection.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/vpn-manager/nm-vpn-connection.c b/src/vpn-manager/nm-vpn-connection.c
index d240804..4329cb2 100644
--- a/src/vpn-manager/nm-vpn-connection.c
+++ b/src/vpn-manager/nm-vpn-connection.c
@@ -1937,7 +1937,7 @@ get_secrets_cb (NMSettingsConnection *connection,
        priv->secrets_id = 0;
-       if (error) {
+       if (error && priv->secrets_idx >= SECRETS_REQ_NEW) {
                nm_log_err (LOGD_VPN, "Failed to request VPN secrets #%d: (%d) %s",
                            priv->secrets_idx + 1, error->code, error->message);
                _set_vpn_state (self, STATE_FAILED, NM_VPN_CONNECTION_STATE_REASON_NO_SECRETS, FALSE);

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