Re: [PATCH] Fix saving secrets in system scope



On Wed, 2011-08-17 at 13:51 +0300, Ozan Çağlayan wrote:
> ---
>  properties/nm-pptp.c |   11 +++++++++++
>  1 files changed, 11 insertions(+), 0 deletions(-)

Applied, thanks!
Dan

> diff --git a/properties/nm-pptp.c b/properties/nm-pptp.c
> index 39f2447..bc43a79 100644
> --- a/properties/nm-pptp.c
> +++ b/properties/nm-pptp.c
> @@ -408,6 +408,17 @@ update_connection (NMVpnPluginUiWidgetInterface *iface,
>  	if (priv->advanced)
>  		g_hash_table_foreach (priv->advanced, hash_copy_advanced, s_vpn);
>  
> +	/* System secrets get stored in the connection, user secrets are saved
> +	 * via the save_secrets() hook.
> +	 */
> +	if (nm_connection_get_scope (connection) == NM_CONNECTION_SCOPE_SYSTEM) {
> +		widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "user_password_entry"));
> +		str = gtk_entry_get_text (GTK_ENTRY (widget));
> +		if (str && strlen (str)) {
> +			nm_setting_vpn_add_secret(s_vpn, NM_PPTP_KEY_PASSWORD, str);
> +		}
> +	}
> +
>  	nm_connection_add_setting (connection, NM_SETTING (s_vpn));
>  	valid = TRUE;
>  




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