pptp: Clear password if authentication fails
authorJukka Rissanen <jukka.rissanen@linux.intel.com>
Wed, 13 Feb 2013 15:28:57 +0000 (17:28 +0200)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Tue, 19 Feb 2013 10:51:34 +0000 (12:51 +0200)
This allows plugin to query agent so that user can give
new password.

Fixes BMC#25963

vpn/plugins/pptp.c

index daa6ca3..0e6b07a 100644 (file)
@@ -133,8 +133,14 @@ static int pptp_notify(DBusMessage *msg, struct vpn_provider *provider)
                return VPN_STATE_FAILURE;
        }
 
-       if (strcmp(reason, "auth failed") == 0)
+       if (strcmp(reason, "auth failed") == 0) {
+               DBG("authentication failure");
+
+               vpn_provider_set_string(provider, "PPTP.User", NULL);
+               vpn_provider_set_string(provider, "PPTP.Password", NULL);
+
                return VPN_STATE_AUTH_FAILURE;
+       }
 
        if (strcmp(reason, "connect"))
                return VPN_STATE_DISCONNECT;