Re: [NM-openconnect PATCH] Allow 'lasthost' and 'autoconnect' settings.
- From: Dan Williams <dcbw redhat com>
- To: David Woodhouse <dwmw2 infradead org>
- Cc: networkmanager-list gnome org
- Subject: Re: [NM-openconnect PATCH] Allow 'lasthost' and 'autoconnect' settings.
- Date: Mon, 30 Mar 2009 23:32:20 -0400
On Wed, 2009-03-25 at 15:02 +0000, David Woodhouse wrote:
> I updated the auth-dialog¹ to remember the last VPN server used, and
> also added a setting to make it automatically start connecting rather
> than waiting for the user to choose a host (on the basis that the user
> will probably choose the same host every time, and doesn't want to
> wait).
>
> I tried using a boolean in gconf for the latter, but NetworkManager
> doesn't seem to work with that, and the key ends up getting deleted
> every time I connect. So I reverted to a string containing 'yes' or
> 'no', which seems to be what's done elsewhere. Should we just fix the
> configuration handling to cope with real GConf booleans instead?
Not really, because the types of the variables are specific to the VPN
daemon, and the code to handle that was pretty icky. Yes, it means a
bit of extra validation, but on the flip side it means that *any*
system-settings plugin can store the VPN's data, not just GConf. Flat
text file formats like GKeyFile/.ini have no concept of typed values,
and even if they did, they wouldn't know what the VPN daemon expected.
To ensure that we didn't need to do acrobatics to get all that working,
VPN-specific data is required to be strings and converted as necessary
within the VPN plugin code itself.
svn r 41 (trunk) and 44 (0.7)
Want to send the auth-dialog patches if you don't get back your svn
access for a few days?
Dan
> diff --git a/src/nm-openconnect-service.c b/src/nm-openconnect-service.c
> index 8c7fd3a..68fcd15 100644
> --- a/src/nm-openconnect-service.c
> +++ b/src/nm-openconnect-service.c
> @@ -54,6 +54,8 @@ static ValidProperty valid_properties[] = {
> { NM_OPENCONNECT_KEY_XMLCONFIG, G_TYPE_STRING, 0, 0 },
> { NM_OPENCONNECT_KEY_PRIVKEY, G_TYPE_STRING, 0, 0 },
> { NM_OPENCONNECT_KEY_CERTSIGS, G_TYPE_STRING, 0, 0 },
> + { NM_OPENCONNECT_KEY_LASTHOST, G_TYPE_STRING, 0, 0 },
> + { NM_OPENCONNECT_KEY_AUTOCONNECT, G_TYPE_BOOLEAN, 0, 0 },
> { NULL, G_TYPE_NONE, 0, 0 }
> };
>
> diff --git a/src/nm-openconnect-service.h b/src/nm-openconnect-service.h
> index 92db840..71b74ba 100644
> --- a/src/nm-openconnect-service.h
> +++ b/src/nm-openconnect-service.h
> @@ -27,6 +27,8 @@
> #define NM_OPENCONNECT_KEY_USERNAME "username"
> #define NM_OPENCONNECT_KEY_XMLCONFIG "xmlconfig"
> #define NM_OPENCONNECT_KEY_CERTSIGS "certsigs"
> +#define NM_OPENCONNECT_KEY_LASTHOST "lasthost"
> +#define NM_OPENCONNECT_KEY_AUTOCONNECT "autoconnect"
>
> #define NM_OPENCONNECT_AUTHTYPE_CERT "cert"
> #define NM_OPENCONNECT_AUTHTYPE_CERT_TPM "cert-tpm"
> --
> 1.6.0.6
>
>
>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]