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

upload of ekg fixing user registration



Hi,

In addition to the earlier changes to token file format (see
http://lists.debian.org/debian-release/2006/03/msg00022.html), the GG
servers have now recently changed the registration reply. The attached
interdiff of an upload I plan to make to volatile makes it possible to
register a new number again using ekg/libgadu.

regards,

Marcin
-- 
Marcin Owsiany <porridge@debian.org>             http://marcin.owsiany.pl/
GnuPG: 1024D/60F41216  FE67 DA2D 0ACA FC5E 3F75  D6F6 3A0D 8AA0 60F4 1216
diff -u ekg-1.5+20050411/debian/changelog ekg-1.5+20050411/debian/changelog
--- ekg-1.5+20050411/debian/changelog	2005-07-19 01:22:50.530519304 +0200
+++ ekg-1.5+20050411/debian/changelog	2006-05-09 20:08:41.136634280 +0100
@@ -1,3 +1,14 @@
+ekg (1:1.5+20050411-6) stable; urgency=medium
+
+  * Mitigate changes in tokens sent by GG servers Closes: #355257
+    - use better libjpeg error handling than the default exit()
+    - fix preprocessor commands to make it possible to download the token when
+      built with libjpeg
+    - add a note to README.Debian on how to use tokens
+  * Add support for new registration reply
+
+ -- Marcin Owsiany <porridge@debian.org>  Tue,  9 May 2006 20:08:06 +0100
+
 ekg (1:1.5+20050411-5) stable-security; urgency=high
 
   * Security upload
diff -u ekg-1.5+20050411/debian/README.Debian ekg-1.5+20050411/debian/README.Debian
--- ekg-1.5+20050411/debian/README.Debian	2005-07-19 01:08:36.629332016 +0200
+++ ekg-1.5+20050411/debian/README.Debian	2006-03-07 19:25:32.474388744 +0000
@@ -61,0 +62,13 @@
+
+Token support
+-------------
+
+ At the beginning of 2006 the GG servers changed from JPEG tokens to GIFs, which
+ breaks token OCR support in ekg.  You should now view them with an external
+ program, after disabling OCR with:
+ 
+ /set display_token 0
+ /save
+
+ -- Marcin Owsiany <porridge@debian.org>, Tue, 07 Mar 2006 20:21:28 +0100
+
only in patch2:
unchanged:
--- ekg-1.5+20050411.orig/docs/protocol.html	2004-12-21 21:42:43.000000000 +0000
+++ ekg-1.5+20050411/docs/protocol.html	2006-05-09 20:07:36.388477496 +0100
@@ -1347,13 +1347,21 @@
 </p>
 
 <div class="http">
-<pre>reg_success:<b>UIN</b></pre>
+<pre>Tokens okregisterreply_packet.reg.dwUserId=<b>UIN</b></pre>
 </div>
 
 <p>
 Gdzie <tt><b>UIN</b></tt> to nowy numer, który właśnie otrzymaliśmy.
 </p>
 
+<p>
+Jeśli został podany nieprawidłowy token, serwer odpowie:
+</p>
+
+<div class="http">
+<pre>bad_tokenval</pre>
+</div>
+
 <hr />
 
 <a name="ch2.4"></a>
only in patch2:
unchanged:
--- ekg-1.5+20050411.orig/lib/pubdir.c	2005-03-20 00:43:44.000000000 +0000
+++ ekg-1.5+20050411/lib/pubdir.c	2006-05-09 20:07:36.477463968 +0100
@@ -447,7 +447,11 @@
 	
 	gg_debug(GG_DEBUG_MISC, "=> pubdir, let's parse \"%s\"\n", h->body);
 
-	if ((tmp = strstr(h->body, "success")) || (tmp = strstr(h->body, "results"))) {
+	if ((tmp = strstr(h->body, "Tokens okregisterreply_packet.reg.dwUserId="))) {
+		p->success = 1;
+		p->uin = strtol(tmp + sizeof("Tokens okregisterreply_packet.reg.dwUserId=") - 1, NULL, 0);
+		gg_debug(GG_DEBUG_MISC, "=> pubdir, success (okregisterreply, uin=%d)\n", p->uin);
+	} else if ((tmp = strstr(h->body, "success")) || (tmp = strstr(h->body, "results"))) {
 		p->success = 1;
 		if (tmp[7] == ':')
 			p->uin = strtol(tmp + 8, NULL, 0);
only in patch2:
unchanged:
--- ekg-1.5+20050411.orig/src/events.c	2005-04-09 22:08:36.000000000 +0100
+++ ekg-1.5+20050411/src/events.c	2006-03-07 19:11:55.752549336 +0000
@@ -33,6 +33,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <setjmp.h>
 #include <unistd.h>
 
 #include "commands.h"
@@ -1499,6 +1500,21 @@
 	return NULL;
 }
 
+#ifdef HAVE_LIBJPEG
+
+struct ekg_jpeg_error_mgr {
+	struct jpeg_error_mgr pub;
+	jmp_buf setjmp_buffer;
+};
+
+void ekg_jpeg_error_exit(j_common_ptr j)
+{
+	struct ekg_jpeg_error_mgr *e = (struct ekg_jpeg_error_mgr *) j->err;
+	/* Return control to the setjmp point */
+	longjmp(e->setjmp_buffer, 1);
+}
+#endif
+
 /*
  * handle_token()
  *
@@ -1552,7 +1568,7 @@
 #ifdef HAVE_LIBJPEG
 	if (config_display_token) {
 		struct jpeg_decompress_struct j;
-		struct jpeg_error_mgr e;
+		struct ekg_jpeg_error_mgr e;
 		JSAMPROW buf[1];
 		int size;
 		char *token, *tmp;
@@ -1564,7 +1580,18 @@
 			goto fail;
 		}
 
-		j.err = jpeg_std_error(&e);
+		j.err = jpeg_std_error(&e.pub);
+		e.pub.error_exit = ekg_jpeg_error_exit;
+		/* Establish the setjmp return context for ekg_jpeg_error_exit to use. */
+		if (setjmp(e.setjmp_buffer)) {
+			char buf[JMSG_LENGTH_MAX];
+			/* If we ended up over here, then it means some call below called longjmp. */
+			(e.pub.format_message)((j_common_ptr)&j, buf);
+			print("token_failed", buf);
+			jpeg_destroy_decompress(&j);
+			fclose(f);
+			goto fail;
+		}
 		jpeg_create_decompress(&j);
 		jpeg_stdio_src(&j, f);
 		jpeg_read_header(&j, TRUE);
@@ -1606,7 +1633,7 @@
 		
 		unlink(file);
 	} else
-#else	/* HAVE_LIBJPEG */
+#endif	/* HAVE_LIBJPEG */
 	{
 		char *file2 = saprintf("%s.jpg", file);
 
@@ -1617,7 +1644,6 @@
 
 		xfree(file2);
 	}
-#endif	/* HAVE_LIBJPEG */
 
 #else	/* HAVE_MKSTEMP */
 	print("token_unsupported");

Reply to: