[network-manager-applet/rm-userset] agent: only save agent-owned secrets



commit 1cb1c0b6869cc8d34110f879477a66daad6c8e71
Author: Dan Williams <dcbw redhat com>
Date:   Tue Feb 1 12:52:02 2011 -0600

    agent: only save agent-owned secrets

 src/applet-agent.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/applet-agent.c b/src/applet-agent.c
index da4500c..9d9c28c 100644
--- a/src/applet-agent.c
+++ b/src/applet-agent.c
@@ -525,12 +525,19 @@ write_one_secret_to_keyring (NMSetting *setting,
 	GnomeKeyringAttributeList *attrs;
 	char *display_name = NULL;
 	KeyringCall *call;
+	NMSettingSecretFlags secret_flags = NM_SETTING_SECRET_FLAG_SYSTEM_OWNED;
 
 	/* non-secrets and private key paths don't get stored in the keyring */
 	if (   !(flags & NM_SETTING_PARAM_SECRET)
 	    || (NM_IS_SETTING_802_1X (setting) && string_in_list (key, applet_8021x_cert_keys)))
 		return;
 
+	/* Don't system-owned or always-ask secrets */
+	if (!nm_setting_get_secret_flags (setting, key, &secret_flags, NULL))
+		return;
+	if (secret_flags != NM_SETTING_SECRET_FLAG_AGENT_OWNED)
+		return;
+
 	/* VPN secrets are handled by the VPN plugins */
 	if (   (type == DBUS_TYPE_G_MAP_OF_STRING)
 	    && NM_IS_SETTING_VPN (setting)



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