diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2009-10-15 17:39:26 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2009-10-15 17:39:26 +0100 |
commit | aa75908bdee6796514f2d1096b5ab84e1e85ea39 (patch) | |
tree | f5379e8a4360350aaccf7853a6f8d33fdaae7e6b | |
parent | 6ce9cb5fe15c46b159df114b123cf1f558a5824f (diff) | |
parent | 984a124a9a11dec00d0c75a00689f01ccb7d8b54 (diff) |
Merge branch 'telepathy-glib-0.8'
Conflicts:
NEWS
-rw-r--r-- | NEWS | 5 | ||||
-rw-r--r-- | telepathy-glib/connection-manager.c | 31 |
2 files changed, 27 insertions, 9 deletions
@@ -23,6 +23,11 @@ Fixes: until we have at least worked out whether it was initially running, in order to provide the documented behaviour (smcv) +* When getting parameter details from a running connection manager, consider + parameters called "password" or ending with "-password" to be secret even + if they lack the SECRET flag, as was already done when reading .manager + files (smcv) + telepathy-glib 0.9.0 (2009-09-28) ================================= diff --git a/telepathy-glib/connection-manager.c b/telepathy-glib/connection-manager.c index 193e3a049..6e573ee27 100644 --- a/telepathy-glib/connection-manager.c +++ b/telepathy-glib/connection-manager.c @@ -454,6 +454,15 @@ tp_connection_manager_got_parameters (TpConnectionManager *self, DEBUG ("\tParam flags: 0x%x", param->flags); DEBUG ("\tParam sig: %s", param->dbus_signature); + if ((!tp_strdiff (param->name, "password") || + g_str_has_suffix (param->name, "-password")) && + (param->flags & TP_CONN_MGR_PARAM_FLAG_SECRET) == 0) + { + DEBUG ("\tTreating as secret due to its name (please fix %s)", + self->name); + param->flags |= TP_CONN_MGR_PARAM_FLAG_SECRET; + } + #ifdef ENABLE_DEBUG { gchar *repr = g_strdup_value_contents (&(param->default_value)); @@ -976,8 +985,9 @@ parse_default_value (GValue *value, } static GPtrArray * -tp_connection_manager_read_file (const gchar *filename, - GError **error) +tp_connection_manager_read_file (const gchar *cm_name, + const gchar *filename, + GError **error) { GKeyFile *file; gchar **groups, **group; @@ -1061,12 +1071,6 @@ tp_connection_manager_read_file (const gchar *filename, param->dbus_signature = g_strdup (strv[0]); - if (!tp_strdiff (param->name, "password") || - g_str_has_suffix (param->name, "-password")) - { - param->flags |= TP_CONN_MGR_PARAM_FLAG_SECRET; - } - for (iter = strv + 1; *iter != NULL; iter++) { if (!tp_strdiff (*iter, "required")) @@ -1081,6 +1085,15 @@ tp_connection_manager_read_file (const gchar *filename, g_strfreev (strv); + if ((!tp_strdiff (param->name, "password") || + g_str_has_suffix (param->name, "-password")) && + (param->flags & TP_CONN_MGR_PARAM_FLAG_SECRET) == 0) + { + DEBUG ("\tTreating %s as secret due to its name (please " + "fix %s)", param->name, cm_name); + param->flags |= TP_CONN_MGR_PARAM_FLAG_SECRET; + } + def = g_strdup_printf ("default-%s", param->name); value = g_key_file_get_string (file, *group, def, NULL); @@ -1144,7 +1157,7 @@ tp_connection_manager_idle_read_manager_file (gpointer data) { GError *error = NULL; GPtrArray *protocols = tp_connection_manager_read_file ( - self->priv->manager_file, &error); + self->name, self->priv->manager_file, &error); DEBUG ("Read %s", self->priv->manager_file); |