[evolution-data-server] CamelURL: Remove 'passwd' member.



commit b9d6fbb68ae52630cf6a61f3075e14d7e3599ae4
Author: Matthew Barnes <mbarnes redhat com>
Date:   Sun Sep 25 21:04:44 2011 -0400

    CamelURL: Remove 'passwd' member.
    
    No longer needed, and signals to other 3rd party Camel providers that
    they need to use the new CamelService:password property instead.

 camel/camel-service.c                       |    7 ++---
 camel/camel-url.c                           |   36 +++------------------------
 camel/camel-url.h                           |   10 ++-----
 docs/reference/camel/camel-sections.txt     |    1 -
 docs/reference/camel/tmpl/camel-unused.sgml |    8 ++++++
 docs/reference/camel/tmpl/camel-url.sgml    |   11 --------
 6 files changed, 18 insertions(+), 55 deletions(-)
---
diff --git a/camel/camel-service.c b/camel/camel-service.c
index 01f501f..2163656 100644
--- a/camel/camel-service.c
+++ b/camel/camel-service.c
@@ -533,7 +533,7 @@ service_initable_init (GInitable *initable,
 	url = camel_service_get_camel_url (service);
 	provider = camel_service_get_provider (service);
 
-	url_string = camel_url_to_string (url, CAMEL_URL_HIDE_PASSWORD);
+	url_string = camel_url_to_string (url, 0);
 
 	if (CAMEL_PROVIDER_NEEDS (provider, CAMEL_URL_PART_USER)) {
 		if (url->user == NULL || *url->user == '\0') {
@@ -1052,8 +1052,7 @@ camel_service_get_camel_url (CamelService *service)
  * @service: a #CamelService
  *
  * Gets the URL representing @service. The returned URL must be
- * freed when it is no longer needed. For security reasons, this
- * routine does not return the password.
+ * freed when it is no longer needed.
  *
  * Returns: the URL representing @service
  **/
@@ -1066,7 +1065,7 @@ camel_service_get_url (CamelService *service)
 
 	url = camel_service_get_camel_url (service);
 
-	return camel_url_to_string (url, CAMEL_URL_HIDE_PASSWORD);
+	return camel_url_to_string (url, 0);
 }
 
 /**
diff --git a/camel/camel-url.c b/camel/camel-url.c
index 119544d..7341a74 100644
--- a/camel/camel-url.c
+++ b/camel/camel-url.c
@@ -129,11 +129,9 @@ camel_url_new_with_base (CamelURL *base,
 		if (at && at < slash) {
 			colon = strchr (url_string, ':');
 			if (colon && colon < at) {
-				url->passwd = g_strndup (colon + 1,
-							 at - colon - 1);
-				camel_url_decode (url->passwd);
+				/* XXX We used to extract and store the
+				 *     password here, now we just eat it. */
 			} else {
-				url->passwd = NULL;
 				colon = at;
 			}
 
@@ -152,7 +150,7 @@ camel_url_new_with_base (CamelURL *base,
 			camel_url_decode (url->user);
 			url_string = at + 1;
 		} else
-			url->user = url->passwd = url->authmech = NULL;
+			url->user = url->authmech = NULL;
 
 		/* Find host and port. */
 		colon = strchr (url_string, ':');
@@ -217,7 +215,7 @@ camel_url_new_with_base (CamelURL *base,
 	if (base && !url->protocol && url->host)
 		url->protocol = g_strdup (base->protocol);
 	else if (base && !url->protocol) {
-		if (!url->user && !url->authmech && !url->passwd &&
+		if (!url->user && !url->authmech &&
 		    !url->host && !url->port && !url->path &&
 		    !url->params && !url->query && !url->fragment)
 			url->fragment = g_strdup (base->fragment);
@@ -225,7 +223,6 @@ camel_url_new_with_base (CamelURL *base,
 		url->protocol = g_strdup (base->protocol);
 		url->user = g_strdup (base->user);
 		url->authmech = g_strdup (base->authmech);
-		url->passwd = g_strdup (base->passwd);
 		url->host = g_strdup (base->host);
 		url->port = base->port;
 
@@ -376,10 +373,6 @@ camel_url_to_string (CamelURL *url,
 				g_string_append (str, ";auth=");
 				append_url_encoded (str, url->authmech, ":@/");
 			}
-			if (url->passwd && !(flags & CAMEL_URL_HIDE_PASSWORD)) {
-				g_string_append_c (str, ':');
-				append_url_encoded (str, url->passwd, "@/");
-			}
 			g_string_append_c (str, '@');
 		}
 		append_url_encoded (str, url->host, ":/");
@@ -433,8 +426,6 @@ void
 camel_url_free (CamelURL *url)
 {
 	if (url) {
-		if (url->passwd)
-			memset (url->passwd, 0, strlen (url->passwd));
 		if (url->user)
 			memset (url->user, 0, strlen (url->user));
 		if (url->host)
@@ -442,7 +433,6 @@ camel_url_free (CamelURL *url)
 		g_free (url->protocol);
 		g_free (url->user);
 		g_free (url->authmech);
-		g_free (url->passwd);
 		g_free (url->host);
 		g_free (url->path);
 		g_datalist_clear (&url->params);
@@ -505,23 +495,6 @@ camel_url_set_authmech (CamelURL *url,
 }
 
 /**
- * camel_url_set_passwd:
- * @url: a #CamelURL
- * @passwd: password
- *
- * Set the password of a #CamelURL.
- **/
-void
-camel_url_set_passwd (CamelURL *url,
-                      const gchar *passwd)
-{
-	g_return_if_fail (url != NULL);
-
-	g_free (url->passwd);
-	url->passwd = g_strdup (passwd);
-}
-
-/**
  * camel_url_set_host:
  * @url: a #CamelURL
  * @host: hostname
@@ -805,7 +778,6 @@ camel_url_copy (CamelURL *in)
 	out->protocol = g_strdup (in->protocol);
 	out->user = g_strdup (in->user);
 	out->authmech = g_strdup (in->authmech);
-	out->passwd = g_strdup (in->passwd);
 	out->host = g_strdup (in->host);
 	out->port = in->port;
 	out->path = g_strdup (in->path);
diff --git a/camel/camel-url.h b/camel/camel-url.h
index a8e89c1..660a10d 100644
--- a/camel/camel-url.h
+++ b/camel/camel-url.h
@@ -43,7 +43,6 @@ struct _CamelURL {
 	gchar  *protocol;
 	gchar  *user;
 	gchar  *authmech;
-	gchar  *passwd;
 	gchar  *host;
 	gint    port;
 	gchar  *path;
@@ -53,13 +52,12 @@ struct _CamelURL {
 };
 
 typedef enum {
-	CAMEL_URL_HIDE_PASSWORD = 1 << 0,
-	CAMEL_URL_HIDE_PARAMS   = 1 << 1,
-	CAMEL_URL_HIDE_AUTH     = 1 << 2
+	CAMEL_URL_HIDE_PARAMS   = 1 << 0,
+	CAMEL_URL_HIDE_AUTH     = 1 << 1
 } CamelURLFlags;
 
 #define CAMEL_URL_HIDE_ALL \
-	(CAMEL_URL_HIDE_PASSWORD | CAMEL_URL_HIDE_PARAMS | CAMEL_URL_HIDE_AUTH)
+	(CAMEL_URL_HIDE_PARAMS | CAMEL_URL_HIDE_AUTH)
 
 GType		camel_url_get_type		(void) G_GNUC_CONST;
 CamelURL *	camel_url_new_with_base		(CamelURL *base,
@@ -86,8 +84,6 @@ void		camel_url_set_user		(CamelURL *url,
 						 const gchar *user);
 void		camel_url_set_authmech		(CamelURL *url,
 						 const gchar *authmech);
-void		camel_url_set_passwd		(CamelURL *url,
-						 const gchar *passwd);
 void		camel_url_set_host		(CamelURL *url,
 						 const gchar *host);
 void		camel_url_set_port		(CamelURL *url,
diff --git a/docs/reference/camel/camel-sections.txt b/docs/reference/camel/camel-sections.txt
index 6a68a00..b68550c 100644
--- a/docs/reference/camel/camel-sections.txt
+++ b/docs/reference/camel/camel-sections.txt
@@ -2985,7 +2985,6 @@ camel_url_decode_path
 camel_url_set_protocol
 camel_url_set_user
 camel_url_set_authmech
-camel_url_set_passwd
 camel_url_set_host
 camel_url_set_port
 camel_url_set_path
diff --git a/docs/reference/camel/tmpl/camel-unused.sgml b/docs/reference/camel/tmpl/camel-unused.sgml
index 41c74f5..c4ea47d 100644
--- a/docs/reference/camel/tmpl/camel-unused.sgml
+++ b/docs/reference/camel/tmpl/camel-unused.sgml
@@ -9388,6 +9388,14 @@ streams
 @type: 
 @Returns: 
 
+<!-- ##### FUNCTION camel_url_set_passwd ##### -->
+<para>
+
+</para>
+
+ url: 
+ passwd: 
+
 <!-- ##### FUNCTION camel_ustrstrcase ##### -->
 <para>
 
diff --git a/docs/reference/camel/tmpl/camel-url.sgml b/docs/reference/camel/tmpl/camel-url.sgml
index e9cbb52..5e5d575 100644
--- a/docs/reference/camel/tmpl/camel-url.sgml
+++ b/docs/reference/camel/tmpl/camel-url.sgml
@@ -28,7 +28,6 @@ camel-url
 @protocol: 
 @user: 
 @authmech: 
- passwd: 
 @host: 
 @port: 
 @path: 
@@ -41,7 +40,6 @@ camel-url
 
 </para>
 
- CAMEL_URL_HIDE_PASSWORD: 
 @CAMEL_URL_HIDE_PARAMS: 
 @CAMEL_URL_HIDE_AUTH: 
 
@@ -144,15 +142,6 @@ camel-url
 @authmech: 
 
 
-<!-- ##### FUNCTION camel_url_set_passwd ##### -->
-<para>
-
-</para>
-
- url: 
- passwd: 
-
-
 <!-- ##### FUNCTION camel_url_set_host ##### -->
 <para>
 



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