Package: liferea
Version: 1.6.3-1
Severity: normal
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu maverick ubuntu-patch



*** /tmp/tmpHXo8qP
In Ubuntu, we've applied the attached patch to achieve the following:

  * debian/patches/google-reader-auth.patch: fix Google reader
    authentication (LP: #597532)

We thought you might be interested in doing the same. 


-- System Information:
Debian Release: squeeze/sid
  APT prefers maverick-updates
  APT policy: (500, 'maverick-updates'), (500, 'maverick-security'), (500, 
'maverick-proposed'), (500, 'maverick')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.35-5-generic (SMP w/2 CPU cores)
Locale: LANG=en_CA.utf8, LC_CTYPE=en_CA.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff -u liferea-1.6.3/debian/changelog liferea-1.6.3/debian/changelog
diff -u liferea-1.6.3/debian/patches/series liferea-1.6.3/debian/patches/series
--- liferea-1.6.3/debian/patches/series
+++ liferea-1.6.3/debian/patches/series
@@ -10,0 +11 @@
+google-reader-auth.patch
only in patch2:
unchanged:
--- liferea-1.6.3.orig/debian/patches/google-reader-auth.patch
+++ liferea-1.6.3/debian/patches/google-reader-auth.patch
@@ -0,0 +1,251 @@
+Description: fix Google reader authentication
+Bug: http://sourceforge.net/tracker/?func=detail&aid=3019939&group_id=87005&atid=581684
+Origin: upstream, http://liferea.svn.sourceforge.net/viewvc/liferea?view=revision&revision=5403
+Origin: upstream, http://liferea.svn.sourceforge.net/viewvc/liferea?view=revision&revision=5404
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/liferea/+bug/597532
+
+diff -Nur liferea-1.6.3/src/fl_sources/google_source.c liferea-1.6.3.new/src/fl_sources/google_source.c
+--- liferea-1.6.3/src/fl_sources/google_source.c	2009-07-17 16:59:01.000000000 -0400
++++ liferea-1.6.3.new/src/fl_sources/google_source.c	2010-06-25 14:46:03.000000000 -0400
+@@ -66,7 +66,7 @@
+ 
+ 	update_job_cancel_by_owner (gsource);
+ 	
+-	g_free (gsource->sid);
++	g_free (gsource->authHeaderValue);
+ 	g_queue_free (gsource->actionQueue) ;
+ 	g_hash_table_unref (gsource->lastTimestampMap);
+ 	g_free (gsource);
+@@ -88,21 +88,21 @@
+ 	gchar		*tmp = NULL;
+ 	subscriptionPtr subscription = gsource->root->subscription;
+ 		
+-	debug0 (DEBUG_UPDATE, "google login processing...");
++	debug1 (DEBUG_UPDATE, "google login processing... %s", result->data);
+ 	
+-	g_assert (!gsource->sid);
++	g_assert (!gsource->authHeaderValue);
+ 	
+ 	if (result->data && result->httpstatus == 200)
+-		tmp = strstr (result->data, "SID=");
++		tmp = strstr (result->data, "Auth=");
+ 		
+ 	if (tmp) {
+ 		gchar *ttmp = tmp; 
+ 		tmp = strchr (tmp, '\n');
+ 		if (tmp)
+ 			*tmp = '\0';
+-		gsource->sid = g_strdup (ttmp);
++		gsource->authHeaderValue = g_strdup_printf ("GoogleLogin auth=%s", ttmp + 5);
+ 
+-		debug1 (DEBUG_UPDATE, "google reader SID found: %s", gsource->sid);
++		debug1 (DEBUG_UPDATE, "google reader Auth token found: %s", gsource->authHeaderValue);
+ 		/* now that we are authenticated trigger updating to start data retrieval */
+ 		gsource->loginState = GOOGLE_SOURCE_STATE_ACTIVE;
+ 		if (!(flags & GOOGLE_SOURCE_UPDATE_ONLY_LOGIN))
+@@ -112,7 +112,7 @@
+ 		google_source_edit_process (gsource);
+ 
+ 	} else {
+-		debug0 (DEBUG_UPDATE, "google reader login failed! no SID found in result!");
++		debug0 (DEBUG_UPDATE, "google reader login failed! no Auth token found in result!");
+ 		subscription->node->available = FALSE;
+ 
+ 		g_free (subscription->updateError);
+@@ -125,7 +125,7 @@
+ 
+ /**
+  * Perform a login to Google Reader, if the login completes the 
+- * GoogleSource will have a valid sid and will have loginStatus to 
++ * GoogleSource will have a valid Auth token and will have loginStatus to 
+  * GOOGLE_SOURCE_LOGIN_ACTIVE.
+  */
+ void
+diff -Nur liferea-1.6.3/src/fl_sources/google_source_edit.c liferea-1.6.3.new/src/fl_sources/google_source_edit.c
+--- liferea-1.6.3/src/fl_sources/google_source_edit.c	2009-05-01 14:53:16.000000000 -0400
++++ liferea-1.6.3.new/src/fl_sources/google_source_edit.c	2010-06-25 14:45:55.000000000 -0400
+@@ -384,7 +384,7 @@
+ 	request = update_request_new ();
+ 	request->updateState = update_state_copy (gsource->root->subscription->updateState);
+ 	request->options = update_options_copy (gsource->root->subscription->updateOptions) ;
+-	update_state_set_cookies (request->updateState, gsource->sid);
++	update_request_set_auth_value (request, gsource->authHeaderValue);
+ 
+ 	if (action->actionType == EDIT_ACTION_MARK_READ || 
+ 	    action->actionType == EDIT_ACTION_MARK_UNREAD || 
+@@ -421,7 +421,7 @@
+ 	request->updateState = update_state_copy (gsource->root->subscription->updateState);
+ 	request->options = update_options_copy (gsource->root->subscription->updateOptions);
+ 	request->source = g_strdup (GOOGLE_READER_TOKEN_URL);
+-	update_state_set_cookies (request->updateState, gsource->sid);
++	update_request_set_auth_value(request, gsource->authHeaderValue);
+ 
+ 	update_execute_request (gsource, request, google_source_edit_token_cb, 
+ 	                        g_strdup(gsource->root->id), 0);
+diff -Nur liferea-1.6.3/src/fl_sources/google_source_feed.c liferea-1.6.3.new/src/fl_sources/google_source_feed.c
+--- liferea-1.6.3/src/fl_sources/google_source_feed.c	2009-05-01 14:53:16.000000000 -0400
++++ liferea-1.6.3.new/src/fl_sources/google_source_feed.c	2010-06-25 14:45:55.000000000 -0400
+@@ -348,7 +348,7 @@
+ 		g_free (newUrl);
+ 		g_free (source_escaped);
+ 	}
+-	update_state_set_cookies (request->updateState, gsource->sid);
++	update_request_set_auth_value (request, gsource->authHeaderValue);
+ 	return TRUE;
+ }
+ 
+diff -Nur liferea-1.6.3/src/fl_sources/google_source.h liferea-1.6.3.new/src/fl_sources/google_source.h
+--- liferea-1.6.3/src/fl_sources/google_source.h	2009-05-01 14:53:16.000000000 -0400
++++ liferea-1.6.3.new/src/fl_sources/google_source.h	2010-06-25 14:46:03.000000000 -0400
+@@ -29,7 +29,7 @@
+  */
+ typedef struct GoogleSource {
+ 	nodePtr	        root;	/**< the root node in the feed list */
+-	gchar		*sid;	/**< session id */
++	gchar           *authHeaderValue; /**< the Google Authorization token */
+ 	GQueue          *actionQueue;
+ 	int             loginState; /**< The current login state */
+ 
+@@ -77,15 +77,15 @@
+  * Google Reader Login api.
+  * @param Email The google account email id.
+  * @param Passwd The google account password.
+- * @return The return data has a line "SID=xxxx" which should be stored to be
+- *         used as a cookie in future requests. 
++ * @return The return data has a line "Auth=xxxx" which will be used as an
++ *         Authorization header in future requests. 
+  */ 
+ #define GOOGLE_READER_LOGIN_URL "https://www.google.com/accounts/ClientLogin"; 
+ #define GOOGLE_READER_LOGIN_POST "service=reader&Email=%s&Passwd=%s&source=liferea&continue=http://www.google.com";
+ 
+ /**
+  * Acts like a feed, indicating all the posts shared by the Google Reader
+- * friends. Does not take any params, but 'sid' cookie needs to be set.
++ * friends. Does not take any params, but the Authorization header needs to be set.
+  */
+ #define GOOGLE_READER_BROADCAST_FRIENDS_URL "http://www.google.com/reader/atom/user/-/state/com.google/broadcast-friends"; 
+ 
+diff -Nur liferea-1.6.3/src/fl_sources/google_source_opml.c liferea-1.6.3.new/src/fl_sources/google_source_opml.c
+--- liferea-1.6.3/src/fl_sources/google_source_opml.c	2009-06-02 06:14:45.000000000 -0400
++++ liferea-1.6.3.new/src/fl_sources/google_source_opml.c	2010-06-25 14:45:55.000000000 -0400
+@@ -70,7 +70,6 @@
+ 		if (!node->subscription || !node->subscription->source) 
+ 			continue;
+ 		if (g_str_equal (node->subscription->source, GOOGLE_READER_BROADCAST_FRIENDS_URL)) {
+-			update_state_set_cookies (node->subscription->updateState, gsource->sid);
+ 			return;
+ 		}
+ 		iter = g_slist_next (iter);
+@@ -87,7 +86,6 @@
+ 	node_set_parent (node, gsource->root, -1);
+ 	feedlist_node_imported (node);
+ 	
+-	update_state_set_cookies (node->subscription->updateState, gsource->sid);
+ 	subscription_update (node->subscription, FEED_REQ_RESET_TITLE | FEED_REQ_PRIORITY_HIGH);
+ 	subscription_update_favicon (node->subscription);
+ }
+@@ -148,7 +146,6 @@
+ 		while (iter) {
+ 			node = (nodePtr)iter->data;
+ 			if (g_str_equal (node->subscription->source, url)) {
+-				update_state_set_cookies (node->subscription->updateState, gsource->sid);
+ 				node->subscription->type = &googleSourceFeedSubscriptionType;
+ 				goto cleanup ;
+ 			}
+@@ -165,7 +162,6 @@
+ 		node_set_parent (node, gsource->root, -1);
+ 		feedlist_node_imported (node);
+ 		
+-		update_state_set_cookies (node->subscription->updateState, gsource->sid);
+ 		/**
+ 		 * @todo mark the ones as read immediately after this is done
+ 		 * the feed as retrieved by this has the read and unread
+@@ -310,9 +306,9 @@
+ 	updateRequestPtr request = update_request_new ();
+ 	request->updateState = update_state_copy (gsource->root->subscription->updateState);
+ 	request->options = update_options_copy (gsource->root->subscription->updateOptions);
+-	update_state_set_cookies (request->updateState, gsource->sid);
+ 	update_request_set_source (request, GOOGLE_READER_UNREAD_COUNTS_URL);
+-	
++	update_request_set_auth_value(request, gsource->authHeaderValue);
++
+ 	update_execute_request (gsource, request, google_source_quick_update_cb,
+ 				gsource, 0);
+ 
+@@ -341,7 +337,7 @@
+ 	
+ 	update_request_set_source (request, GOOGLE_READER_SUBSCRIPTION_LIST_URL);
+ 	
+-	update_state_set_cookies (request->updateState, gsource->sid);
++	update_request_set_auth_value (request, gsource->authHeaderValue);
+ 	
+ 	return TRUE;
+ }
+diff -Nur liferea-1.6.3/src/net.c liferea-1.6.3.new/src/net.c
+--- liferea-1.6.3/src/net.c	2010-01-09 07:57:24.000000000 -0500
++++ liferea-1.6.3.new/src/net.c	2010-06-25 14:45:55.000000000 -0400
+@@ -156,7 +156,8 @@
+ 	}
+ 
+ 	/* Set the authentication */
+-	if (job->request->options &&
++	if (!job->request->authValue &&
++	    job->request->options &&
+ 	    job->request->options->username &&
+ 	    job->request->options->password) {
+ 		SoupURI *uri = soup_message_get_uri (msg);
+@@ -165,6 +166,11 @@
+ 		soup_uri_set_password (uri, job->request->options->password);
+ 	}
+ 
++	if (job->request->authValue) {
++		soup_message_headers_append (msg->request_headers, "Authorization",
++					     job->request->authValue);
++	}
++
+ 	/* Add requested cookies */
+ 	if (job->request->updateState && job->request->updateState->cookies) {
+ 		soup_message_headers_append (msg->request_headers, "Cookie",
+diff -Nur liferea-1.6.3/src/update.c liferea-1.6.3.new/src/update.c
+--- liferea-1.6.3/src/update.c	2009-07-17 16:59:01.000000000 -0400
++++ liferea-1.6.3.new/src/update.c	2010-06-25 14:45:55.000000000 -0400
+@@ -155,6 +155,13 @@
+ 	request->source = g_strdup(source) ;
+ }
+ 
++void
++update_request_set_auth_value(updateRequestPtr request, const gchar* authValue)
++{
++	g_free(request->authValue);
++	request->authValue = g_strdup(authValue);
++}
++
+ updateResultPtr
+ update_result_new (void)
+ {
+diff -Nur liferea-1.6.3/src/update.h liferea-1.6.3.new/src/update.h
+--- liferea-1.6.3/src/update.h	2009-05-01 14:53:18.000000000 -0400
++++ liferea-1.6.3.new/src/update.h	2010-06-25 14:45:55.000000000 -0400
+@@ -101,6 +101,7 @@
+ 					     filename. Eventually, everything should be a
+ 					     URL. Use file:// and exec:// */
+ 	gchar           *postdata;      /**< HTTP POST request data (NULL for non-POST requests) */
++	gchar           *authValue;     /**< Custom value for Authorization: header */
+ 	updateOptionsPtr options;	/**< Update options for the request */
+ 	gchar		*filtercmd;	/**< Command will filter output of URL */
+ 	gboolean	allowRetries;	/**< Allow download retries on network errors */
+@@ -211,6 +212,14 @@
+ void update_request_set_source(updateRequestPtr request, gchar* source);
+ 
+ /**
++ * Sets a custom authorization header value.
++ *
++ * @param request        the update request
++ * @param authValue      the authorization header value
++ */
++void update_request_set_auth_value(updateRequestPtr request, const gchar* authValue);
++
++/**
+  * Creates a new update result for the given update request.
+  *
+  * @param request	the update request

Reply via email to