[network-manager-netbook/MplPanelClient: 29/44] fix retrieval of 802.1x private key passwords



commit d69e3eb461ae0c3279bfa95c9460d74f4f810042
Author: Dan Williams <dcbw redhat com>
Date:   Tue Sep 29 17:10:24 2009 -0700

    fix retrieval of 802.1x private key passwords
    
    Use NMSettingsConnectionInterface to get secrets instead of two
    different codepaths for system and user secrets.  But since
    returning secrets to NM via D-Bus requires decrypting the private
    key (and thus the password isn't required), we still need a way
    to get the actual private key password out of the generic GetSecrets
    handler for NMAGConfConnection.  Hijack the "include_private_passwords"
    argument of nm_gconf_get_keyring_items() to do this for us.
    
    (port of nm-applet commit 6c32fdcdbb73196e77428ec9ce50925506d78d03)

 src/wireless-security/helpers.c |   25 ++++---------------------
 1 files changed, 4 insertions(+), 21 deletions(-)
---
diff --git a/src/wireless-security/helpers.c b/src/wireless-security/helpers.c
index 9b08713..47deb6a 100644
--- a/src/wireless-security/helpers.c
+++ b/src/wireless-security/helpers.c
@@ -31,9 +31,6 @@ helper_fill_secret_entry (NMConnection *connection,
                           const char *secret_name)
 {
 	NMSetting *setting;
-	GHashTable *secrets;
-	GError *error = NULL;
-	GValue *value;
 	const char *tmp;
 
 	g_return_if_fail (connection != NULL);
@@ -43,24 +40,10 @@ helper_fill_secret_entry (NMConnection *connection,
 	g_return_if_fail (secret_name != NULL);
 
 	setting = nm_connection_get_setting (connection, setting_type);
-
-	if (nm_connection_get_scope (connection) == NM_CONNECTION_SCOPE_SYSTEM) {
-		if (setting) {
-			tmp = (*func) (setting);
-			if (tmp)
-				gtk_entry_set_text (entry, tmp);
-		}
-	} else {
-		secrets = nm_gconf_get_keyring_items (connection, setting_name, FALSE, &error);
-		if (!secrets) {
-			g_clear_error (&error);
-			return;
-		}
-
-		value = g_hash_table_lookup (secrets, secret_name);
-		if (value)
-			gtk_entry_set_text (entry, g_value_get_string (value));
-		g_hash_table_destroy (secrets);
+	if (setting) {
+		tmp = (*func) (setting);
+		if (tmp)
+			gtk_entry_set_text (entry, tmp);
 	}
 }
 



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