From 13e49239bdd799ce123d18bd6f18b70361f7cb77 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 18 Feb 2009 14:01:33 -0500 Subject: [PATCH] system-settings: don't return secrets in the settings Since only authorized users should be able to get secrets, don't return them in the GetSettings handlers; callers need to use GetSecrets instead. --- system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.c | 5 ++++- system-settings/plugins/ifcfg-suse/nm-suse-connection.c | 5 ++++- system-settings/plugins/ifupdown/nm-ifupdown-connection.c | 5 ++++- system-settings/plugins/keyfile/nm-keyfile-connection.c | 5 ++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.c b/system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.c index 3589cffd63..96829375bb 100644 --- a/system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.c +++ b/system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.c @@ -319,7 +319,10 @@ nm_ifcfg_connection_get_unmanaged (NMIfcfgConnection *self) static GHashTable * get_settings (NMExportedConnection *exported) { - return nm_connection_to_hash (nm_exported_connection_get_connection (exported)); + NMConnection *connection = nm_exported_connection_get_connection (exported); + + nm_connection_clear_secrets (connection); + return nm_connection_to_hash (connection); } static gboolean diff --git a/system-settings/plugins/ifcfg-suse/nm-suse-connection.c b/system-settings/plugins/ifcfg-suse/nm-suse-connection.c index c86b31c4f6..4cc92d18e7 100644 --- a/system-settings/plugins/ifcfg-suse/nm-suse-connection.c +++ b/system-settings/plugins/ifcfg-suse/nm-suse-connection.c @@ -126,7 +126,10 @@ nm_suse_connection_new (const char *iface, NMDeviceType dev_type) static GHashTable * get_settings (NMExportedConnection *exported) { - return nm_connection_to_hash (nm_exported_connection_get_connection (exported)); + NMConnection *connection = nm_exported_connection_get_connection (exported); + + nm_connection_clear_secrets (connection); + return nm_connection_to_hash (connection); } static gboolean diff --git a/system-settings/plugins/ifupdown/nm-ifupdown-connection.c b/system-settings/plugins/ifupdown/nm-ifupdown-connection.c index 084065bd8c..d90c8f4143 100644 --- a/system-settings/plugins/ifupdown/nm-ifupdown-connection.c +++ b/system-settings/plugins/ifupdown/nm-ifupdown-connection.c @@ -70,7 +70,10 @@ nm_ifupdown_connection_new (if_block *block) static GHashTable * get_settings (NMExportedConnection *exported) { - return nm_connection_to_hash (nm_exported_connection_get_connection (exported)); + NMConnection *connection = nm_exported_connection_get_connection (exported); + + nm_connection_clear_secrets (connection); + return nm_connection_to_hash (connection); } static gboolean diff --git a/system-settings/plugins/keyfile/nm-keyfile-connection.c b/system-settings/plugins/keyfile/nm-keyfile-connection.c index a202209c57..dc355069ce 100644 --- a/system-settings/plugins/keyfile/nm-keyfile-connection.c +++ b/system-settings/plugins/keyfile/nm-keyfile-connection.c @@ -67,7 +67,10 @@ nm_keyfile_connection_get_filename (NMKeyfileConnection *self) static GHashTable * get_settings (NMExportedConnection *exported) { - return nm_connection_to_hash (nm_exported_connection_get_connection (exported)); + NMConnection *connection = nm_exported_connection_get_connection (exported); + + nm_connection_clear_secrets (connection); + return nm_connection_to_hash (connection); } static GValue *