Your message dated Fri, 21 Nov 2014 13:23:51 +0000
with message-id <2c3250ae05ae97c6f01f44dfa1726...@hogwarts.powdarrmonkey.net>
and subject line Re: Bug#770381: unblock: remmina/1.1.1-2 (pre-approval)
has caused the Debian Bug report #770381,
regarding unblock: remmina/1.1.1-2 (pre-approval)
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
770381: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=770381
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: release.debian.org
Severity: normal
User: release.debian....@packages.debian.org
Usertags: unblock

Hi,

Please consider unblocking a tentative remmina 1.1.1-2 upload, debdiff
attached.
This upload cherry-picks patches from upstream Git to fix #766671. I reproduced
the crash (it's very trivial to test it), and the patch actually solves the
problem.

unblock remmina/1.1.1-2

-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.16.0-4-amd64 (SMP w/2 CPU cores)
diff --git a/debian/changelog b/debian/changelog
index 42e466f..f69d17c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+remmina (1.1.1-2) unstable; urgency=medium
+
+  * debian/patches/RDP_certificate_crash.patch:
+    - Cherry-pick patches from upstream to fix a crash when not
+      accepting certificate for RDP server (Closes: #766671).
+
+ -- Luca Falavigna <dktrkr...@debian.org>  Thu, 20 Nov 2014 21:08:11 +0100
+
 remmina (1.1.1-1) unstable; urgency=medium
 
   * New upstream release.
diff --git a/debian/patches/RDP_certificate_crash.patch b/debian/patches/RDP_certificate_crash.patch
new file mode 100644
index 0000000..40c7bf3
--- /dev/null
+++ b/debian/patches/RDP_certificate_crash.patch
@@ -0,0 +1,154 @@
+Description: Fix crash when not accepting certificate for RDP server
+Author: Giovanni Panozzo <giova...@panozzo.it>
+
+Index: remmina/remmina-plugins/rdp/rdp_event.c
+===================================================================
+--- remmina.orig/remmina-plugins/rdp/rdp_event.c
++++ remmina/remmina-plugins/rdp/rdp_event.c
+@@ -54,6 +54,9 @@ static void remmina_rdp_event_on_focus_i
+ #endif
+ 
+ 	rfi = GET_DATA(gp);
++	if ( !rfi )
++		return;
++
+ 	input = rfi->instance->input;
+ 	UINT32 toggle_keys_state = 0;
+ 
+@@ -88,6 +91,8 @@ static void remmina_rdp_event_event_push
+ 	RemminaPluginRdpEvent* event;
+ 
+ 	rfi = GET_DATA(gp);
++	if ( !rfi )
++		return;
+ 
+ 	if (rfi->event_queue)
+ 	{
+@@ -454,6 +459,8 @@ static gboolean remmina_rdp_event_on_key
+ 	DWORD scancode;
+ 
+ 	rfi = GET_DATA(gp);
++	if ( !rfi ) return TRUE;
++
+ 	rdp_event.type = REMMINA_RDP_EVENT_TYPE_SCANCODE;
+ 	rdp_event.key_event.up = (event->type == GDK_KEY_PRESS ? False : True);
+ 	rdp_event.key_event.extended = False;
+@@ -535,6 +542,8 @@ void remmina_rdp_event_init(RemminaProto
+ 	GtkClipboard* clipboard;
+ 
+ 	rfi = GET_DATA(gp);
++	if ( !rfi ) return;
++
+ 	rfi->drawing_area = gtk_drawing_area_new();
+ 	gtk_widget_show(rfi->drawing_area);
+ 	gtk_container_add(GTK_CONTAINER(gp), rfi->drawing_area);
+@@ -608,7 +617,7 @@ void remmina_rdp_event_uninit(RemminaPro
+ 	RemminaPluginRdpUiObject* ui;
+ 
+ 	rfi = GET_DATA(gp);
+-
++	if ( !rfi ) return;
+ 
+ 	/* unregister the clipboard monitor */
+ 	if (rfi->clipboard_handler)
+Index: remmina/remmina-plugins/rdp/rdp_plugin.c
+===================================================================
+--- remmina.orig/remmina-plugins/rdp/rdp_plugin.c
++++ remmina/remmina-plugins/rdp/rdp_plugin.c
+@@ -338,6 +338,7 @@ static BOOL remmina_rdp_post_connect(fre
+ 	instance->update->DesktopResize = rf_desktop_resize;
+ 
+ 	freerdp_channels_post_connect(instance->context->channels, instance);
++	rfi->connected = True;
+ 
+ 	remmina_plugin_service->protocol_plugin_emit_signal(gp, "connect");
+ 
+@@ -664,7 +665,7 @@ static gboolean remmina_rdp_main(Remmina
+ 		dest_server = remmina_plugin_service->file_get_string(remminafile, "server");
+ 		if ( dest_server ) {
+ 			remmina_plugin_service->get_server_port(dest_server, 0, &dest_host, &dest_port);
+-			rfi->settings->CertificateName = _strdup( dest_host );
++			rfi->settings->CertificateName = strdup( dest_host );
+ 			g_free(dest_host);
+ 		}
+ 	}
+@@ -701,12 +702,17 @@ static gboolean remmina_rdp_main(Remmina
+ 
+ 	if (remmina_plugin_service->file_get_string(remminafile, "clientname"))
+ 	{
+-		strncpy(rfi->settings->ClientHostname, remmina_plugin_service->file_get_string(remminafile, "clientname"),
+-			sizeof(rfi->settings->ClientHostname) - 1);
++		s = remmina_plugin_service->file_get_string(remminafile, "clientname");
++		if ( s ) {
++			free( rfi->settings->ClientHostname );
++			rfi->settings->ClientHostname = strdup(s);
++			g_free(s);
++		}
+ 	}
+ 	else
+ 	{
+-		strncpy(rfi->settings->ClientHostname, g_get_host_name(), sizeof(rfi->settings->ClientHostname) - 1);
++		free( rfi->settings->ClientHostname );
++		rfi->settings->ClientHostname = strdup( g_get_host_name() );
+ 	}
+ 
+ 	if (remmina_plugin_service->file_get_string(remminafile, "exec"))
+@@ -938,6 +944,7 @@ static void remmina_rdp_init(RemminaProt
+ 	rfi->instance = instance;
+ 	rfi->settings = instance->settings;
+ 	rfi->instance->context->channels = freerdp_channels_new();
++	rfi->connected = False;
+ 
+ 	pthread_mutex_init(&rfi->mutex, NULL);
+ 
+@@ -995,13 +1002,12 @@ static gboolean remmina_rdp_close_connec
+ 
+ 	if (instance)
+ 	{
+-		if (instance->context->channels)
+-		{
+-			//freerdp_channels_close(rfi->channels, instance);
+-			freerdp_channels_free(instance->context->channels);
+-			instance->context->channels = NULL;
++		if ( rfi->connected ) {
++			if (instance->context->channels)
++				freerdp_channels_close(instance->context->channels, instance);
++			freerdp_disconnect(instance);
++			rfi->connected = False;
+ 		}
+-		freerdp_disconnect(instance);
+ 	}
+ 
+ 	if (rfi->rfx_context)
+@@ -1012,8 +1018,17 @@ static gboolean remmina_rdp_close_connec
+ 
+ 	if (instance)
+ 	{
+-		//freerdp_context_free(instance); /* context is rfContext* rfi */
++		/* Remove instance->context from gp object data to avoid double free */
++		g_object_steal_data(G_OBJECT(gp), "plugin-data");
++
++		if (instance->context->channels) {
++			freerdp_channels_free(instance->context->channels);
++			instance->context->channels = NULL;
++		}
++
++		freerdp_context_free(instance); /* context is rfContext* rfi */
+ 		freerdp_free(instance);
++		rfi->instance = NULL;
+ 	}
+ 
+ 	return FALSE;
+Index: remmina/remmina-plugins/rdp/rdp_plugin.h
+===================================================================
+--- remmina.orig/remmina-plugins/rdp/rdp_plugin.h
++++ remmina/remmina-plugins/rdp/rdp_plugin.h
+@@ -106,6 +106,8 @@ struct rf_context
+ 
+ 	RFX_CONTEXT* rfx_context;
+ 
++	gboolean connected;
++
+ 	gboolean sw_gdi;
+ 	GtkWidget* drawing_area;
+ 	gint scale_width;
diff --git a/debian/patches/series b/debian/patches/series
index 041e542..ad945e0 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 external_tools.patch
+RDP_certificate_crash.patch

--- End Message ---
--- Begin Message ---
On 2014-11-21 07:10, Luca Falavigna wrote:
2014-11-20 22:17 GMT+01:00 Jonathan Wiltshire <j...@debian.org>:
Please go ahead.

Thanks a lot for the quick reply!
Package uploaded and built everywhere but sparc (but, oh well...)

Unblocked.

--
Jonathan Wiltshire                                      j...@debian.org
Debian Developer                         http://people.debian.org/~jmw

4096R: 0xD3524C51 / 0A55 B7C5 1223 3942 86EC  74C3 5394 479D D352 4C51

<directhex> i have six years of solaris sysadmin experience, from
            8->10. i am well qualified to say it is made from bonghits
                        layered on top of bonghits

--- End Message ---

Reply via email to