Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:pchenthill
evolution-data-server
bnc-303699-eds-proxy-password-prompt.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File bnc-303699-eds-proxy-password-prompt.diff of Package evolution-data-server
Index: libedataserver/e-source.c =================================================================== --- libedataserver/e-source.c (revision 7834) +++ libedataserver/e-source.c (working copy) @@ -46,6 +46,9 @@ gchar *color_spec; GHashTable *properties; + + /* FIXME provide locks at all relevant places */ + GStaticRecMutex rlock; }; @@ -86,6 +89,7 @@ g_free (priv->color_spec); g_hash_table_destroy (priv->properties); + g_static_rec_mutex_free (&priv->rlock); g_free (priv); @@ -136,6 +140,7 @@ priv->properties = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); + g_static_rec_mutex_init (&priv->rlock); } /* Private methods. */ @@ -322,6 +327,9 @@ gboolean retval = FALSE; gboolean changed = FALSE; + + g_static_rec_mutex_lock (&source->priv->rlock); + name = xmlGetProp (node, "name"); relative_uri = xmlGetProp (node, "relative_uri"); absolute_uri = xmlGetProp (node, "uri"); @@ -387,6 +395,8 @@ } retval = TRUE; + + g_static_rec_mutex_unlock (&source->priv->rlock); done: if (changed) @@ -845,14 +855,42 @@ const gchar *property) { ESourcePrivate *priv; + gpointer retval = NULL; g_return_val_if_fail (E_IS_SOURCE (source), NULL); priv = source->priv; - return g_hash_table_lookup (priv->properties, property); + + g_static_rec_mutex_lock (&source->priv->rlock); + + retval = g_hash_table_lookup (priv->properties, property); + + g_static_rec_mutex_unlock (&source->priv->rlock); + + return retval; } +char * +e_source_get_duped_property (ESource *source, const char *property) +{ + ESourcePrivate *priv; + gpointer retval = NULL; + g_return_val_if_fail (E_IS_SOURCE (source), NULL); + priv = source->priv; + + + g_static_rec_mutex_lock (&source->priv->rlock); + + retval = g_strdup (g_hash_table_lookup (priv->properties, property)); + + g_static_rec_mutex_unlock (&source->priv->rlock); + + return retval; + + +} + void e_source_set_property (ESource *source, const gchar *property, @@ -863,11 +901,15 @@ g_return_if_fail (E_IS_SOURCE (source)); priv = source->priv; + g_static_rec_mutex_lock (&source->priv->rlock); + if (value) g_hash_table_replace (priv->properties, g_strdup (property), g_strdup (value)); else g_hash_table_remove (priv->properties, property); + g_static_rec_mutex_unlock (&source->priv->rlock); + g_signal_emit (source, signals[CHANGED], 0); } Index: libedataserver/e-source.h =================================================================== --- libedataserver/e-source.h (revision 7834) +++ libedataserver/e-source.h (working copy) @@ -119,6 +119,7 @@ GHFunc func, gpointer data); +char *e_source_get_duped_property (ESource *source, const char *property); char *e_source_build_absolute_uri (ESource *source); G_END_DECLS Index: calendar/libecal/e-cal.c =================================================================== --- calendar/libecal/e-cal.c (revision 7834) +++ calendar/libecal/e-cal.c (working copy) @@ -1702,8 +1702,7 @@ ECalPrivate *priv; CORBA_Environment ev; ECalendarOp *our_op; - const char *username = NULL, *auth_type = NULL; - char *password = NULL; + char *username = NULL, *auth_type = NULL, *password = NULL; gboolean read_only; e_return_error_if_fail (ecal != NULL, E_CALENDAR_STATUS_INVALID_ARG); @@ -1732,7 +1731,7 @@ /* see if the backend needs authentication */ if ( (priv->mode != CAL_MODE_LOCAL) && e_source_get_property (priv->source, "auth")) { char *prompt, *key; - const char *parent_user; + char *parent_user; priv->load_state = E_CAL_LOAD_AUTHENTICATING; @@ -1745,7 +1744,7 @@ E_CALENDAR_CHECK_STATUS (E_CALENDAR_STATUS_AUTHENTICATION_REQUIRED, error); } - username = e_source_get_property (priv->source, "username"); + username = e_source_get_duped_property (priv->source, "username"); if (!username) { e_calendar_remove_op (ecal, our_op); g_mutex_unlock (our_op->mutex); @@ -1758,11 +1757,11 @@ prompt = g_strdup_printf (_("Enter password for %s (user %s)"), e_source_peek_name (priv->source), username); - auth_type = e_source_get_property (priv->source, "auth-type"); + auth_type = e_source_get_duped_property (priv->source, "auth-type"); if (auth_type) key = build_pass_key (ecal); else { - parent_user = e_source_get_property (priv->source, "parent_id_name"); + parent_user = e_source_get_duped_property (priv->source, "parent_id_name"); if (parent_user) { key = build_proxy_pass_key (ecal, parent_user); /* @@ -1770,9 +1769,11 @@ the auth_func corresponds to the parent user. */ prompt = g_strdup_printf (_("Enter password for %s to enable proxy for user %s"), e_source_peek_name (priv->source), parent_user); + g_free (parent_user); } else key = g_strdup (e_cal_get_uri (ecal)); } + g_free (auth_type); if (!key) { e_calendar_remove_op (ecal, our_op); @@ -1807,8 +1808,8 @@ username ? username : "", password ? password : "", &ev); - if (password) - g_free (password); + g_free (password); + g_free (username); if (BONOBO_EX (&ev)) { e_calendar_remove_op (ecal, our_op);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor