evolution-data-server r8402 - in trunk/camel: . providers/imap providers/imap4 providers/imapp providers/nntp providers/pop3 providers/smtp



Author: mbarnes
Date: Mon Jan 21 20:49:38 2008
New Revision: 8402
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=8402&view=rev

Log:
2008-01-21  Matthew Barnes  <mbarnes redhat com>

	** Fixes bug #510303

	* camel/camel-gpg-context.c (gpg_ctx_parse_status):
	Escape the PIN and passphrase prompts so the markup parser
	will parse it verbatim.

	* camel/providers/nntp/camel-nntp-store.c
	(camel_nntp_try_authenticate):
	* camel/providers/pop3/camel-pop3-store.c (pop3_connect):
	* camel/providers/smtp/camel-smtp-transport.c (smtp_connect):
	* camel/providers/imap/camel-imap-store.c (imap_auth_loop):
	* camel/providers/imapp/camel-imapp-store.c (imap_connect):
	* camel/providers/imap4/camel-imap4-store.c (imap4_reconnect):
	Escape the authentication error message so the markup parser
	will parse it verbatim.



Modified:
   trunk/camel/ChangeLog
   trunk/camel/camel-gpg-context.c
   trunk/camel/providers/imap/ChangeLog
   trunk/camel/providers/imap/camel-imap-store.c
   trunk/camel/providers/imap4/ChangeLog
   trunk/camel/providers/imap4/camel-imap4-store.c
   trunk/camel/providers/imapp/ChangeLog
   trunk/camel/providers/imapp/camel-imapp-store.c
   trunk/camel/providers/nntp/ChangeLog
   trunk/camel/providers/nntp/camel-nntp-store.c
   trunk/camel/providers/pop3/ChangeLog
   trunk/camel/providers/pop3/camel-pop3-store.c
   trunk/camel/providers/smtp/ChangeLog
   trunk/camel/providers/smtp/camel-smtp-transport.c

Modified: trunk/camel/camel-gpg-context.c
==============================================================================
--- trunk/camel/camel-gpg-context.c	(original)
+++ trunk/camel/camel-gpg-context.c	Mon Jan 21 20:49:38 2008
@@ -823,11 +823,13 @@
 			name = "";
 
 		if (!strncmp ((char *) status, "passphrase.pin.ask", 18)) {
-			prompt = g_strdup_printf (_("You need a PIN to unlock the key for your\n"
-						    "SmartCard: \"%s\""), name);
+			prompt = g_markup_printf_escaped (
+				_("You need a PIN to unlock the key for your\n"
+				  "SmartCard: \"%s\""), name);
 		} else if (!strncmp ((char *) status, "passphrase.enter", 16)) {
-			prompt = g_strdup_printf (_("You need a passphrase to unlock the key for\n"
-						    "user: \"%s\""), name);
+			prompt = g_markup_printf_escaped (
+				_("You need a passphrase to unlock the key for\n"
+				  "user: \"%s\""), name);
 		} else {
 			next_token ((char *) status, &prompt);
 			camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,

Modified: trunk/camel/providers/imap/camel-imap-store.c
==============================================================================
--- trunk/camel/providers/imap/camel-imap-store.c	(original)
+++ trunk/camel/providers/imap/camel-imap-store.c	Mon Jan 21 20:49:38 2008
@@ -1418,7 +1418,8 @@
 			if (camel_exception_get_id(ex) == CAMEL_EXCEPTION_USER_CANCEL)
 				return FALSE;
 
-			errbuf = g_strdup_printf (_("Unable to authenticate "
+			errbuf = g_markup_escaped_text (
+				_("Unable to authenticate "
 				"to IMAP server.\n%s\n\n"),
 				camel_exception_get_description (ex));
 			camel_exception_clear (ex);

Modified: trunk/camel/providers/imap4/camel-imap4-store.c
==============================================================================
--- trunk/camel/providers/imap4/camel-imap4-store.c	(original)
+++ trunk/camel/providers/imap4/camel-imap4-store.c	Mon Jan 21 20:49:38 2008
@@ -541,7 +541,7 @@
 		camel_exception_init (&lex);
 		while (imap4_try_authenticate (engine, reprompt, errmsg, &lex)) {
 			g_free (errmsg);
-			errmsg = g_strdup (lex.desc);
+			errmsg = g_markup_escape_text (lex.desc, -1);
 			camel_exception_clear (&lex);
 			g_free (service->url->passwd);
 			service->url->passwd = NULL;

Modified: trunk/camel/providers/imapp/camel-imapp-store.c
==============================================================================
--- trunk/camel/providers/imapp/camel-imapp-store.c	(original)
+++ trunk/camel/providers/imapp/camel-imapp-store.c	Mon Jan 21 20:49:38 2008
@@ -447,7 +447,7 @@
 				store->login_error = NULL;
 				switch (e->id) {
 				case CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE:
-					store->login_error = g_strdup_printf("%s\n\n", e->desc);
+					store->login_error = g_markup_printf_escaped("%s\n\n", e->desc);
 					camel_session_forget_password(service->session, service, NULL, "password", ex);
 					camel_url_set_passwd(service->url, NULL);
 					break;

Modified: trunk/camel/providers/nntp/camel-nntp-store.c
==============================================================================
--- trunk/camel/providers/nntp/camel-nntp-store.c	(original)
+++ trunk/camel/providers/nntp/camel-nntp-store.c	Mon Jan 21 20:49:38 2008
@@ -1162,7 +1162,8 @@
 		base = camel_session_build_password_prompt (
 			"NNTP", service->url->user, service->url->host);
 		if (line) {
-			char *top = g_strdup_printf(_("Cannot authenticate to server: %s"), line);
+			char *top = g_markup_printf_escaped (
+				_("Cannot authenticate to server: %s"), line);
 
 			prompt = g_strdup_printf("%s\n\n%s", top, base);
 			g_free(top);

Modified: trunk/camel/providers/pop3/camel-pop3-store.c
==============================================================================
--- trunk/camel/providers/pop3/camel-pop3-store.c	(original)
+++ trunk/camel/providers/pop3/camel-pop3-store.c	Mon Jan 21 20:49:38 2008
@@ -615,7 +615,7 @@
 
 		/* we only re-prompt if we failed to authenticate, any other error and we just abort */
 		if (status == 0 && camel_exception_get_id (ex) == CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE) {
-			errbuf = g_strdup_printf ("%s\n\n", camel_exception_get_description (ex));
+			errbuf = g_markup_printf_escaped ("%s\n\n", camel_exception_get_description (ex));
 			g_free (service->url->passwd);
 			service->url->passwd = NULL;
 			reprompt = TRUE;

Modified: trunk/camel/providers/smtp/camel-smtp-transport.c
==============================================================================
--- trunk/camel/providers/smtp/camel-smtp-transport.c	(original)
+++ trunk/camel/providers/smtp/camel-smtp-transport.c	Mon Jan 21 20:49:38 2008
@@ -555,9 +555,10 @@
 
 			authenticated = smtp_auth (transport, authtype->authproto, ex);
 			if (!authenticated) {
-				errbuf = g_strdup_printf (_("Unable to authenticate "
-							    "to SMTP server.\n%s\n\n"),
-							  camel_exception_get_description (ex));
+				errbuf = g_markup_printf_escaped (
+					_("Unable to authenticate "
+					  "to SMTP server.\n%s\n\n"),
+					camel_exception_get_description (ex));
 				camel_exception_clear (ex);
 			}
 		}



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