[evolution-patches] Exchange connector - Fix for evolution crash



Hi,

This patch fixes a crash because of uninitialized error value.
Also fixes the wrong OOF message display in case of authentication
failure and some compile time warings.

Please review,
Thanks,
Sushma.
Index: evolution-data-server/servers/exchange/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/servers/exchange/ChangeLog,v
retrieving revision 1.35
diff -u -p -r1.35 ChangeLog
--- evolution-data-server/servers/exchange/ChangeLog	21 Oct 2005 10:36:59 -0000	1.35
+++ evolution-data-server/servers/exchange/ChangeLog	24 Nov 2005 10:44:32 -0000
@@ -1,3 +1,10 @@
+2005-11-24  Sushma Rai  <rsushma novell com>
+
+	* storage/exchange-account.c (exchange_account_remove_folder)
+	(get_password)(exchange_account_connect): Fix for compile time warnings.
+	(exchange_account_connect): Initialize the return value, info_result
+	before cheking the validity of ExchangeAccount. Fixes a crash.
+
 2005-10-21  Sarfraaz Ahmed <asarfraaz novell com>
 
 	* storage/exchange-account.c (exchange_account_remove_folder) : Proceed
Index: evolution-data-server/servers/exchange/storage/exchange-account.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/servers/exchange/storage/exchange-account.c,v
retrieving revision 1.19
diff -u -p -r1.19 exchange-account.c
--- evolution-data-server/servers/exchange/storage/exchange-account.c	21 Oct 2005 10:36:59 -0000	1.19
+++ evolution-data-server/servers/exchange/storage/exchange-account.c	24 Nov 2005 10:45:18 -0000
@@ -540,7 +540,7 @@ exchange_account_remove_folder (Exchange
 	int_uri = e_folder_exchange_get_internal_uri (folder);
 
 	if (g_hash_table_find (account->priv->standard_uris, 
-					check_if_sf, int_uri)) {
+					check_if_sf, (char *)int_uri)) {
 		return EXCHANGE_ACCOUNT_FOLDER_UNSUPPORTED_OPERATION;
 	}
 
@@ -924,16 +924,15 @@ static gboolean
 get_password (ExchangeAccount *account, E2kAutoconfig *ac, ExchangeAccountResult error)
 {
 	char *password;
-	gboolean remember, oldremember;
 
 	if (error != EXCHANGE_ACCOUNT_CONNECT_SUCCESS)
 		e_passwords_forget_password ("Exchange", account->priv->password_key);
 
 	password = e_passwords_get_password ("Exchange", account->priv->password_key);
-
+#if 0
 	// SURF : if (exchange_component_is_interactive (global_exchange_component)) {
+		gboolean remember, oldremember;
 		if (!password) {
-	/*
 			char *prompt;
 
 			prompt = g_strdup_printf (_("Enter password for %s"),
@@ -952,7 +951,6 @@ get_password (ExchangeAccount *account, 
 				account->priv->account->source->save_passwd = remember;
 			}
 			g_free (prompt);
-	*/
 		} 
 		else if (!account->priv->account->source->save_passwd) {
 			/* get_password returns the password cached but user has not 
@@ -961,7 +959,17 @@ get_password (ExchangeAccount *account, 
 		 	 */
 			e_passwords_forget_password ("Exchange", account->priv->password_key);
 		}
-	// SURF : }
+	}
+#endif
+	if (!password) {
+	}
+	else if (!account->priv->account->source->save_passwd) {
+		/* get_password returns the password cached but user has not 
+	 	 * selected remember password option, forget this password 
+	 	 * whis is stored temporarily by e2k_validate_user() 
+	 	 */
+		e_passwords_forget_password ("Exchange", account->priv->password_key);
+	}
 
 	if (password) {
 		e2k_autoconfig_set_password (ac, password);
@@ -1413,13 +1421,13 @@ exchange_account_connect (ExchangeAccoun
 	int nresults;
 	GByteArray *entryid;
 	const char *timezone;
-	char *old_password, *new_password;
 	E2kGlobalCatalogStatus gcstatus;
 	E2kGlobalCatalogEntry *entry;
 	E2kOperation gcop;
 	char *user_name = NULL;
 	int offline;
 
+	*info_result = EXCHANGE_ACCOUNT_UNKNOWN_ERROR; 
 	g_return_val_if_fail (EXCHANGE_IS_ACCOUNT (account), NULL);
 
 	*info_result = EXCHANGE_ACCOUNT_CONNECT_SUCCESS;
@@ -1488,6 +1496,7 @@ exchange_account_connect (ExchangeAccoun
 			g_mutex_unlock (account->priv->connect_lock);
 			return NULL;
 /*
+			char *old_password, *new_password;
 			old_password = exchange_account_get_password (account);
 			//new_password = exchange_get_new_password (old_password, 0);
 
@@ -1705,7 +1714,7 @@ E2kContext *
 exchange_account_get_context (ExchangeAccount *account)
 {
 	g_return_val_if_fail (EXCHANGE_IS_ACCOUNT (account), NULL);
-		
+
 	return account->priv->ctx;
 }
 
Index: evolution/plugins/exchange-operations/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/plugins/exchange-operations/ChangeLog,v
retrieving revision 1.60
diff -u -p -r1.60 ChangeLog
--- evolution/plugins/exchange-operations/ChangeLog	24 Nov 2005 10:03:51 -0000	1.60
+++ evolution/plugins/exchange-operations/ChangeLog	24 Nov 2005 10:46:33 -0000
@@ -4,6 +4,7 @@
 	OOF state and check for the OOF state and message only of the account
 	is valid. Fixes the problem of printing OOF error message in case
 	of authentication failure.
+	(set_oof_info): Similar.
 
 2005-10-03  Shakti Sen <shprasad novell com>
 
Index: evolution/plugins/exchange-operations/exchange-account-setup.c
===================================================================
RCS file: /cvs/gnome/evolution/plugins/exchange-operations/exchange-account-setup.c,v
retrieving revision 1.22
diff -u -p -r1.22 exchange-account-setup.c
--- evolution/plugins/exchange-operations/exchange-account-setup.c	24 Nov 2005 10:03:52 -0000	1.22
+++ evolution/plugins/exchange-operations/exchange-account-setup.c	24 Nov 2005 10:46:53 -0000
@@ -692,11 +692,10 @@ set_oof_info ()
 
 	account = exchange_operations_get_exchange_account ();
 
-	if (!exchange_oof_set (account, oof_data->state, oof_data->message)) {
+	if (account && !exchange_oof_set (account, oof_data->state, oof_data->message)) {
 
 		e_error_run (NULL, ERROR_DOMAIN ":state-update-error", NULL);
 	}
-
 }
 
 static void


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