Bug#1070820: vinagre: fix compatibility with FreeRDP 2.1.1+
Zixing Liu
zixing.liu at canonical.com
Thu May 9 20:41:40 BST 2024
Package: vinagre
Version: 3.22.0-8.1
Severity: important
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu oracular ubuntu-patch
Dear Maintainer,
This set of patches fix the compatibility with FreeRDP 2.1.1+.
The patches are cherry-picked from the upstream and pending Merge Requests
in the upstream's GitLab instance.
Some of the previous patches got replaced by a newer revision in the upstream
source repository.
In Ubuntu, the attached patch was applied to achieve the following:
* Fix compatibility with FreeRDP 2.1.1 security update.
- debian/patches/freerdp*.patch: backport series of upstream patches to
fix compatibility wither newer FreeRDP versions.
- d/p/0001-Revert-Improve-FreeRDP-authentication-failure-handli.patch:
removed, no longer needed.
- d/p/0002-Revert-Store-credentials-for-RDP.patch: removed, no longer
needed.
- d/p/freerdp2017.patch: removed, replaced with upstream patches.
- d/patches: re-import patches from the upstream and refresh the patches
against the Ubuntu-patched source tree.
Thanks for considering the patch.
-- System Information:
Debian Release: trixie/sid
APT prefers noble-updates
APT policy: (500, 'noble-updates'), (500, 'noble-security'), (500, 'noble'), (100, 'noble-backports')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 6.8.0-31-generic (SMP w/10 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8), LANGUAGE=en_CA:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
-------------- next part --------------
diff -Nru vinagre-3.22.0/debian/control vinagre-3.22.0/debian/control
--- vinagre-3.22.0/debian/control 2021-05-16 15:11:19.000000000 -0600
+++ vinagre-3.22.0/debian/control 2024-05-08 15:11:43.000000000 -0600
@@ -18,6 +18,7 @@
libspice-client-gtk-3.0-dev (>= 0.5) [linux-any],
libavahi-ui-gtk3-dev (>= 0.6.26),
libavahi-gobject-dev (>= 0.6.26),
+ libdbus-glib-1-dev,
libsecret-1-dev,
valac (>= 0.12.0),
yelp-tools,
diff -Nru vinagre-3.22.0/debian/control.in vinagre-3.22.0/debian/control.in
--- vinagre-3.22.0/debian/control.in 2020-12-31 17:05:07.000000000 -0700
+++ vinagre-3.22.0/debian/control.in 2024-05-08 15:11:43.000000000 -0600
@@ -14,6 +14,7 @@
libspice-client-gtk-3.0-dev (>= 0.5) [linux-any],
libavahi-ui-gtk3-dev (>= 0.6.26),
libavahi-gobject-dev (>= 0.6.26),
+ libdbus-glib-1-dev,
libsecret-1-dev,
valac (>= 0.12.0),
yelp-tools,
diff -Nru vinagre-3.22.0/debian/patches/0001-Revert-Improve-FreeRDP-authentication-failure-handli.patch vinagre-3.22.0/debian/patches/0001-Revert-Improve-FreeRDP-authentication-failure-handli.patch
--- vinagre-3.22.0/debian/patches/0001-Revert-Improve-FreeRDP-authentication-failure-handli.patch 2020-02-13 04:42:44.000000000 -0700
+++ vinagre-3.22.0/debian/patches/0001-Revert-Improve-FreeRDP-authentication-failure-handli.patch 1969-12-31 17:00:00.000000000 -0700
@@ -1,53 +0,0 @@
-From 8ebc0685b85e0d1f70eb00171f2e7712de3d44bd Mon Sep 17 00:00:00 2001
-From: Michael Biebl <biebl at debian.org>
-Date: Thu, 22 Sep 2016 01:15:55 +0200
-Subject: [PATCH 1/2] Revert "Improve FreeRDP authentication failure handling"
-
-This reverts commit d7b4f88943e8615d252d27e1efc58cb64a9e1821.
----
- plugins/rdp/vinagre-rdp-tab.c | 10 ++++++----
- 1 file changed, 6 insertions(+), 4 deletions(-)
-
-diff --git a/plugins/rdp/vinagre-rdp-tab.c b/plugins/rdp/vinagre-rdp-tab.c
-index b731f9b..8572bc3 100644
---- a/plugins/rdp/vinagre-rdp-tab.c
-+++ b/plugins/rdp/vinagre-rdp-tab.c
-@@ -1195,8 +1195,8 @@ open_freerdp (VinagreRdpTab *rdp_tab)
- VinagreTab *tab = VINAGRE_TAB (rdp_tab);
- GtkWindow *window = GTK_WINDOW (vinagre_tab_get_window (tab));
- gboolean success = TRUE;
-+ gboolean authentication_error = FALSE;
- gboolean cancelled = FALSE;
-- guint authentication_errors = 0;
-
- priv->events = g_queue_new ();
-
-@@ -1205,12 +1205,14 @@ open_freerdp (VinagreRdpTab *rdp_tab)
-
- do
- {
-+ authentication_error = FALSE;
-+
- /* Run FreeRDP session */
- success = freerdp_connect (priv->freerdp_session);
- if (!success)
- {
-- authentication_errors += freerdp_get_last_error (priv->freerdp_session->context) == 0x20009 ||
-- freerdp_get_last_error (priv->freerdp_session->context) == 0x2000c;
-+ authentication_error = freerdp_get_last_error (priv->freerdp_session->context) == 0x20009 ||
-+ freerdp_get_last_error (priv->freerdp_session->context) == 0x2000c;
-
- cancelled = freerdp_get_last_error (priv->freerdp_session->context) == 0x2000b;
-
-@@ -1218,7 +1220,7 @@ open_freerdp (VinagreRdpTab *rdp_tab)
- init_freerdp (rdp_tab);
- }
- }
-- while (!success && authentication_errors < 3);
-+ while (!success && authentication_error);
-
- if (!success)
- {
---
-2.9.3
-
diff -Nru vinagre-3.22.0/debian/patches/0002-Revert-Store-credentials-for-RDP.patch vinagre-3.22.0/debian/patches/0002-Revert-Store-credentials-for-RDP.patch
--- vinagre-3.22.0/debian/patches/0002-Revert-Store-credentials-for-RDP.patch 2020-02-13 04:42:44.000000000 -0700
+++ vinagre-3.22.0/debian/patches/0002-Revert-Store-credentials-for-RDP.patch 1969-12-31 17:00:00.000000000 -0700
@@ -1,445 +0,0 @@
-From bb1828b6b7eb29bb037bcc687cf10f916ddc7561 Mon Sep 17 00:00:00 2001
-From: Michael Biebl <biebl at debian.org>
-Date: Thu, 22 Sep 2016 01:18:16 +0200
-Subject: [PATCH 2/2] Revert "Store credentials for RDP"
-
-This reverts commit 60dea279a24c7f0e398b89a0a60d45e80087ed1d.
----
- plugins/rdp/vinagre-rdp-connection.c | 22 +---
- plugins/rdp/vinagre-rdp-plugin.c | 29 +----
- plugins/rdp/vinagre-rdp-tab.c | 231 +++++++++++++++++------------------
- 3 files changed, 123 insertions(+), 159 deletions(-)
-
-diff --git a/plugins/rdp/vinagre-rdp-connection.c b/plugins/rdp/vinagre-rdp-connection.c
-index f0ff02b..c5f6ed1 100644
---- a/plugins/rdp/vinagre-rdp-connection.c
-+++ b/plugins/rdp/vinagre-rdp-connection.c
-@@ -127,25 +127,9 @@ rdp_parse_item (VinagreConnection *conn, xmlNode *root)
- static void
- rdp_parse_options_widget (VinagreConnection *conn, GtkWidget *widget)
- {
-- const gchar *text;
-- GtkWidget *u_entry, *d_entry, *spin_button, *scaling_button;
-- gboolean scaling;
-- guint width, height;
--
-- d_entry = g_object_get_data (G_OBJECT (widget), "domain_entry");
-- if (!d_entry)
-- {
-- g_warning ("Wrong widget passed to rdp_parse_options_widget()");
-- return;
-- }
--
-- text = gtk_entry_get_text (GTK_ENTRY (d_entry));
-- vinagre_cache_prefs_set_string ("rdp-connection", "domain", text);
--
-- g_object_set (conn,
-- "domain", text != NULL && *text != '\0' ? text : NULL,
-- NULL);
--
-+ GtkWidget *u_entry, *spin_button, *scaling_button;
-+ gboolean scaling;
-+ guint width, height;
-
- u_entry = g_object_get_data (G_OBJECT (widget), "username_entry");
- if (!u_entry)
-diff --git a/plugins/rdp/vinagre-rdp-plugin.c b/plugins/rdp/vinagre-rdp-plugin.c
-index 4751102..f41da37 100644
---- a/plugins/rdp/vinagre-rdp-plugin.c
-+++ b/plugins/rdp/vinagre-rdp-plugin.c
-@@ -100,7 +100,7 @@ vinagre_rdp_plugin_init (VinagreRdpPlugin *plugin)
- static GtkWidget *
- impl_get_connect_widget (VinagreProtocol *plugin, VinagreConnection *conn)
- {
-- GtkWidget *grid, *label, *u_entry, *d_entry, *spin_button, *check;
-+ GtkWidget *grid, *label, *u_entry, *spin_button, *check;
- gchar *str;
- gint width, height;
-
-@@ -146,29 +146,10 @@ impl_get_connect_widget (VinagreProtocol *plugin, VinagreConnection *conn)
- g_free (str);
-
-
-- label = gtk_label_new_with_mnemonic (_("_Domain:"));
-- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-- gtk_grid_attach (GTK_GRID (grid), label, 0, 3, 1, 1);
-- gtk_widget_set_margin_left (label, 12);
--
-- d_entry = gtk_entry_new ();
-- /* Translators: This is the tooltip for the domain field in a RDP connection */
-- gtk_widget_set_tooltip_text (d_entry, _("Optional."));
-- g_object_set_data (G_OBJECT (grid), "domain_entry", d_entry);
-- gtk_grid_attach (GTK_GRID (grid), d_entry, 1, 3, 1, 1);
-- gtk_label_set_mnemonic_widget (GTK_LABEL (label), d_entry);
-- str = g_strdup (VINAGRE_IS_CONNECTION (conn) ?
-- vinagre_connection_get_domain (conn) :
-- vinagre_cache_prefs_get_string ("rdp-connection", "domain", ""));
-- gtk_entry_set_text (GTK_ENTRY (d_entry), str);
-- gtk_entry_set_activates_default (GTK_ENTRY (d_entry), TRUE);
-- g_free (str);
--
--
- /* Host width */
- label = gtk_label_new_with_mnemonic (_("_Width:"));
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-- gtk_grid_attach (GTK_GRID (grid), label, 0, 4, 1, 1);
-+ gtk_grid_attach (GTK_GRID (grid), label, 0, 3, 1, 1);
- gtk_widget_set_margin_left (label, 12);
-
- spin_button = gtk_spin_button_new_with_range (MIN_SIZE, MAX_SIZE, 1);
-@@ -176,7 +157,7 @@ impl_get_connect_widget (VinagreProtocol *plugin, VinagreConnection *conn)
- gtk_widget_set_tooltip_text (spin_button, _("Set width of the remote desktop"));
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (spin_button), DEFAULT_WIDTH);
- g_object_set_data (G_OBJECT (grid), "width_spin_button", spin_button);
-- gtk_grid_attach (GTK_GRID (grid), spin_button, 1, 4, 1, 1);
-+ gtk_grid_attach (GTK_GRID (grid), spin_button, 1, 3, 1, 1);
- gtk_label_set_mnemonic_widget (GTK_LABEL (label), spin_button);
- width = VINAGRE_IS_CONNECTION (conn) ?
- vinagre_connection_get_width (conn) :
-@@ -188,7 +169,7 @@ impl_get_connect_widget (VinagreProtocol *plugin, VinagreConnection *conn)
- /* Host height */
- label = gtk_label_new_with_mnemonic (_("_Height:"));
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-- gtk_grid_attach (GTK_GRID (grid), label, 0, 5, 1, 1);
-+ gtk_grid_attach (GTK_GRID (grid), label, 0, 4, 1, 1);
- gtk_widget_set_margin_left (label, 12);
-
- spin_button = gtk_spin_button_new_with_range (MIN_SIZE, MAX_SIZE, 1);
-@@ -196,7 +177,7 @@ impl_get_connect_widget (VinagreProtocol *plugin, VinagreConnection *conn)
- gtk_widget_set_tooltip_text (spin_button, _("Set height of the remote desktop"));
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (spin_button), DEFAULT_HEIGHT);
- g_object_set_data (G_OBJECT (grid), "height_spin_button", spin_button);
-- gtk_grid_attach (GTK_GRID (grid), spin_button, 1, 5, 1, 1);
-+ gtk_grid_attach (GTK_GRID (grid), spin_button, 1, 4, 1, 1);
- gtk_label_set_mnemonic_widget (GTK_LABEL (label), spin_button);
- height = VINAGRE_IS_CONNECTION (conn) ?
- vinagre_connection_get_height (conn) :
-diff --git a/plugins/rdp/vinagre-rdp-tab.c b/plugins/rdp/vinagre-rdp-tab.c
-index 8572bc3..f3d9c08 100644
---- a/plugins/rdp/vinagre-rdp-tab.c
-+++ b/plugins/rdp/vinagre-rdp-tab.c
-@@ -70,8 +70,6 @@ struct _VinagreRdpTabPrivate
- gboolean scaling;
- double scale;
- double offset_x, offset_y;
--
-- guint authentication_attempts;
- };
-
- G_DEFINE_TYPE (VinagreRdpTab, vinagre_rdp_tab, VINAGRE_TYPE_TAB)
-@@ -611,7 +609,6 @@ frdp_post_connect (freerdp *instance)
- 0, 0,
- gdi->width, gdi->height);
-
-- vinagre_tab_save_credentials_in_keyring (VINAGRE_TAB (rdp_tab));
- vinagre_tab_add_recent_used (VINAGRE_TAB (rdp_tab));
- vinagre_tab_set_state (VINAGRE_TAB (rdp_tab), VINAGRE_TAB_STATE_CONNECTED);
-
-@@ -862,76 +859,114 @@ frdp_mouse_moved (GtkWidget *widget,
- return TRUE;
- }
-
-+static void
-+entry_text_changed_cb (GtkEntry *entry,
-+ GtkBuilder *builder)
-+{
-+ const gchar *text;
-+ GtkWidget *widget;
-+ gsize username_length;
-+ gsize password_length;
-+
-+ widget = GTK_WIDGET (gtk_builder_get_object (builder, "username_entry"));
-+ text = gtk_entry_get_text (GTK_ENTRY (widget));
-+ username_length = strlen (text);
-+
-+ widget = GTK_WIDGET (gtk_builder_get_object (builder, "password_entry"));
-+ text = gtk_entry_get_text (GTK_ENTRY (widget));
-+ password_length = strlen (text);
-+
-+ widget = GTK_WIDGET (gtk_builder_get_object (builder, "ok_button"));
-+ gtk_widget_set_sensitive (widget, password_length > 0 && username_length > 0);
-+}
-+
- static gboolean
- frdp_authenticate (freerdp *instance,
- char **username,
- char **password,
- char **domain)
- {
-- VinagreTab *tab = VINAGRE_TAB (((frdpContext *) instance->context)->rdp_tab);
-- VinagreRdpTab *rdp_tab = VINAGRE_RDP_TAB (tab);
-- VinagreRdpTabPrivate *priv = rdp_tab->priv;
-- VinagreConnection *conn = vinagre_tab_get_conn (tab);
-- GtkWindow *window = GTK_WINDOW (vinagre_tab_get_window (tab));
-- gboolean save_in_keyring = FALSE;
-- gchar *keyring_domain = NULL;
-- gchar *keyring_username = NULL;
-- gchar *keyring_password = NULL;
-+ VinagreTab *tab = VINAGRE_TAB (((frdpContext *) instance->context)->rdp_tab);
-+ VinagreConnection *conn = vinagre_tab_get_conn (tab);
-+ const gchar *user_name;
-+ const gchar *domain_name;
-+ GtkBuilder *builder;
-+ GtkWidget *dialog;
-+ GtkWidget *widget;
-+ GtkWidget *username_entry;
-+ GtkWidget *password_entry;
-+ GtkWidget *domain_entry;
-+ gboolean save_credential_check_visible;
-+ gboolean domain_label_visible;
-+ gboolean domain_entry_visible;
-+ gint response;
-
-- priv->authentication_attempts++;
-+ builder = vinagre_utils_get_builder ();
-
-- if (priv->authentication_attempts == 1)
-- {
-- vinagre_tab_find_credentials_in_keyring (tab, &keyring_domain, &keyring_username, &keyring_password);
-- if (keyring_password != NULL && keyring_username != NULL)
-- {
-- *domain = keyring_domain;
-- *username = keyring_username;
-- *password = keyring_password;
-+ dialog = GTK_WIDGET (gtk_builder_get_object (builder, "auth_required_dialog"));
-+ gtk_window_set_modal ((GtkWindow *) dialog, TRUE);
-+ gtk_window_set_transient_for ((GtkWindow *) dialog, GTK_WINDOW (vinagre_tab_get_window (tab)));
-
-- return TRUE;
-- }
-- else
-- {
-- g_free (keyring_domain);
-- g_free (keyring_username);
-- g_free (keyring_password);
-- }
-+ widget = GTK_WIDGET (gtk_builder_get_object (builder, "host_label"));
-+ gtk_label_set_text (GTK_LABEL (widget), vinagre_connection_get_host (conn));
-+
-+ username_entry = GTK_WIDGET (gtk_builder_get_object (builder, "username_entry"));
-+ password_entry = GTK_WIDGET (gtk_builder_get_object (builder, "password_entry"));
-+ domain_entry = GTK_WIDGET (gtk_builder_get_object (builder, "domain_entry"));
-+
-+ if (*username != NULL && *username[0] != '\0')
-+ {
-+ gtk_entry_set_text (GTK_ENTRY (username_entry), *username);
-+ gtk_widget_grab_focus (password_entry);
- }
-
-- if (vinagre_utils_request_credential (window,
-- "RDP",
-- vinagre_connection_get_host (conn),
-- vinagre_connection_get_domain (conn),
-- vinagre_connection_get_username (conn),
-- TRUE,
-- TRUE,
-- TRUE,
-- 20,
-- domain,
-- username,
-- password,
-- &save_in_keyring))
-+ g_signal_connect (username_entry, "changed", G_CALLBACK (entry_text_changed_cb), builder);
-+ g_signal_connect (password_entry, "changed", G_CALLBACK (entry_text_changed_cb), builder);
-+
-+
-+ widget = GTK_WIDGET (gtk_builder_get_object (builder, "save_credential_check"));
-+ save_credential_check_visible = gtk_widget_get_visible (widget);
-+ gtk_widget_set_visible (widget, FALSE);
-+
-+ widget = GTK_WIDGET (gtk_builder_get_object (builder, "domain_label"));
-+ domain_label_visible = gtk_widget_get_visible (widget);
-+ gtk_widget_set_visible (widget, TRUE);
-+
-+ domain_entry_visible = gtk_widget_get_visible (domain_entry);
-+ gtk_widget_set_visible (domain_entry, TRUE);
-+
-+
-+ response = gtk_dialog_run (GTK_DIALOG (dialog));
-+ gtk_widget_hide (dialog);
-+
-+
-+ widget = GTK_WIDGET (gtk_builder_get_object (builder, "save_credential_check"));
-+ gtk_widget_set_visible (widget, save_credential_check_visible);
-+
-+ widget = GTK_WIDGET (gtk_builder_get_object (builder, "domain_label"));
-+ gtk_widget_set_visible (widget, domain_label_visible);
-+
-+ gtk_widget_set_visible (domain_entry, domain_entry_visible);
-+
-+
-+ if (response == GTK_RESPONSE_OK)
- {
-- if (*domain && **domain != '\0')
-- vinagre_connection_set_domain (conn, *domain);
-+ domain_name = gtk_entry_get_text (GTK_ENTRY (domain_entry));
-+ if (g_strcmp0 (*domain, domain_name) != 0)
-+ *domain = g_strdup (domain_name);
-
-- if (*username && **username != '\0')
-- vinagre_connection_set_username (conn, *username);
-+ user_name = gtk_entry_get_text (GTK_ENTRY (username_entry));
-+ if (g_strcmp0 (*username, user_name) != 0)
-+ *username = g_strdup (user_name);
-
-- if (*password && **password != '\0')
-- vinagre_connection_set_password (conn, *password);
-+ *password = g_strdup (gtk_entry_get_text (GTK_ENTRY (password_entry)));
-
-- vinagre_tab_set_save_credentials (tab, save_in_keyring);
-+ return TRUE;
- }
- else
- {
-- vinagre_tab_remove_from_notebook (tab);
--
- return FALSE;
- }
--
-- return TRUE;
- }
-
- static BOOL
-@@ -1028,25 +1063,30 @@ frdp_changed_certificate_verify (freerdp *instance,
- #endif
-
- static void
--init_freerdp (VinagreRdpTab *rdp_tab)
-+open_freerdp (VinagreRdpTab *rdp_tab)
- {
- VinagreRdpTabPrivate *priv = rdp_tab->priv;
-- rdpSettings *settings;
- VinagreTab *tab = VINAGRE_TAB (rdp_tab);
- VinagreConnection *conn = vinagre_tab_get_conn (tab);
-- gboolean scaling;
-- gchar *hostname;
-- gint width, height;
-- gint port;
-+ rdpSettings *settings;
-+ GtkWindow *window = GTK_WINDOW (vinagre_tab_get_window (tab));
-+ gboolean success = TRUE;
-+ gboolean fullscreen, scaling;
-+ gchar *hostname, *username;
-+ gint port, width, height;
-
- g_object_get (conn,
- "port", &port,
- "host", &hostname,
- "width", &width,
- "height", &height,
-+ "fullscreen", &fullscreen,
- "scaling", &scaling,
-+ "username", &username,
- NULL);
-
-+ priv->events = g_queue_new ();
-+
- /* Setup FreeRDP session */
- priv->freerdp_session = freerdp_new ();
- priv->freerdp_session->PreConnect = frdp_pre_connect;
-@@ -1111,6 +1151,17 @@ init_freerdp (VinagreRdpTab *rdp_tab)
- settings->port = port;
- #endif
-
-+ /* Set username */
-+ username = g_strstrip (username);
-+ if (username != NULL && username[0] != '\0')
-+ {
-+#if HAVE_FREERDP_1_1
-+ settings->Username = g_strdup (username);
-+#else
-+ settings->username = g_strdup (username);
-+#endif
-+ }
-+
- /* Set keyboard layout */
- #if HAVE_FREERDP_1_1
- freerdp_keyboard_init (KBD_US);
-@@ -1120,24 +1171,6 @@ init_freerdp (VinagreRdpTab *rdp_tab)
-
- /* Allow font smoothing by default */
- settings->AllowFontSmoothing = TRUE;
--}
--
--static void
--init_display (VinagreRdpTab *rdp_tab)
--{
-- VinagreRdpTabPrivate *priv = rdp_tab->priv;
-- VinagreTab *tab = VINAGRE_TAB (rdp_tab);
-- VinagreConnection *conn = vinagre_tab_get_conn (tab);
-- GtkWindow *window = GTK_WINDOW (vinagre_tab_get_window (tab));
-- gboolean fullscreen, scaling;
-- gint width, height;
--
-- g_object_get (conn,
-- "width", &width,
-- "height", &height,
-- "fullscreen", &fullscreen,
-- "scaling", &scaling,
-- NULL);
-
- /* Setup display for FreeRDP session */
- priv->display = gtk_drawing_area_new ();
-@@ -1186,54 +1219,20 @@ init_display (VinagreRdpTab *rdp_tab)
- priv->key_release_handler_id = g_signal_connect (GTK_WIDGET (tab), "key-release-event",
- G_CALLBACK (frdp_key_pressed),
- rdp_tab);
--}
--
--static void
--open_freerdp (VinagreRdpTab *rdp_tab)
--{
-- VinagreRdpTabPrivate *priv = rdp_tab->priv;
-- VinagreTab *tab = VINAGRE_TAB (rdp_tab);
-- GtkWindow *window = GTK_WINDOW (vinagre_tab_get_window (tab));
-- gboolean success = TRUE;
-- gboolean authentication_error = FALSE;
-- gboolean cancelled = FALSE;
--
-- priv->events = g_queue_new ();
--
-- init_freerdp (rdp_tab);
-- init_display (rdp_tab);
--
-- do
-- {
-- authentication_error = FALSE;
-
-- /* Run FreeRDP session */
-- success = freerdp_connect (priv->freerdp_session);
-- if (!success)
-- {
-- authentication_error = freerdp_get_last_error (priv->freerdp_session->context) == 0x20009 ||
-- freerdp_get_last_error (priv->freerdp_session->context) == 0x2000c;
--
-- cancelled = freerdp_get_last_error (priv->freerdp_session->context) == 0x2000b;
--
-- freerdp_free (priv->freerdp_session);
-- init_freerdp (rdp_tab);
-- }
-- }
-- while (!success && authentication_error);
-+ /* Run FreeRDP session */
-+ success = freerdp_connect (priv->freerdp_session);
-
- if (!success)
- {
- gtk_window_unfullscreen (window);
-- if (!cancelled)
-- vinagre_utils_show_error_dialog (_("Error connecting to host."),
-- NULL,
-- window);
-+ vinagre_utils_show_error_dialog (_("Error connecting to host."),
-+ NULL,
-+ window);
- g_idle_add ((GSourceFunc) idle_close, rdp_tab);
- }
- else
- {
-- priv->authentication_attempts = 0;
- priv->update_id = g_idle_add ((GSourceFunc) update, rdp_tab);
- }
- }
---
-2.9.3
-
diff -Nru vinagre-3.22.0/debian/patches/0003-fix-hangs-with-recent-FreeRDP-version.patch vinagre-3.22.0/debian/patches/0003-fix-hangs-with-recent-FreeRDP-version.patch
--- vinagre-3.22.0/debian/patches/0003-fix-hangs-with-recent-FreeRDP-version.patch 2021-02-26 02:32:02.000000000 -0700
+++ vinagre-3.22.0/debian/patches/0003-fix-hangs-with-recent-FreeRDP-version.patch 2024-05-08 15:10:33.000000000 -0600
@@ -20,24 +20,29 @@
plugins/rdp/vinagre-rdp-tab.c | 27 ---------------------------
2 files changed, 1 insertion(+), 28 deletions(-)
+diff --git a/configure.ac b/configure.ac
+index 61617f1a..445b3e74 100644
--- a/configure.ac
+++ b/configure.ac
-@@ -58,7 +58,7 @@
+@@ -58,7 +58,7 @@ AS_IF([test "x$have_ssh" = "xyes"],
AM_CONDITIONAL([VINAGRE_ENABLE_SSH], [test "x$have_ssh" = "xyes"])
# Whether to enable support for RDP.
-RDP_DEPS="freerdp2 x11"
+RDP_DEPS="freerdp2 >= 2.0.0 x11"
+
AC_ARG_ENABLE([rdp],
[AS_HELP_STRING([--disable-rdp],
- [Disable Remote Desktop Protocol (RDP) support])])
+diff --git a/plugins/rdp/vinagre-rdp-tab.c b/plugins/rdp/vinagre-rdp-tab.c
+index bbb8adf5..046b0b95 100644
--- a/plugins/rdp/vinagre-rdp-tab.c
+++ b/plugins/rdp/vinagre-rdp-tab.c
-@@ -524,32 +524,7 @@ frdp_pre_connect (freerdp *instance)
+@@ -522,33 +522,6 @@ frdp_end_paint (rdpContext *context)
+ static BOOL
+ frdp_pre_connect (freerdp *instance)
{
- rdpSettings *settings = instance->settings;
-
--#if HAVE_FREERDP_1_1
+- rdpSettings *settings = instance->settings;
+-
- settings->OrderSupport[NEG_DSTBLT_INDEX] = TRUE;
- settings->OrderSupport[NEG_PATBLT_INDEX] = TRUE;
- settings->OrderSupport[NEG_SCRBLT_INDEX] = TRUE;
@@ -62,17 +67,10 @@
- settings->OrderSupport[NEG_POLYGON_CB_INDEX] = FALSE;
- settings->OrderSupport[NEG_ELLIPSE_SC_INDEX] = FALSE;
- settings->OrderSupport[NEG_ELLIPSE_CB_INDEX] = FALSE;
--#else
-+#if !HAVE_FREERDP_1_1
- settings->order_support[NEG_DSTBLT_INDEX] = true;
- settings->order_support[NEG_PATBLT_INDEX] = true;
- settings->order_support[NEG_SCRBLT_INDEX] = true;
-@@ -1122,6 +1097,8 @@ open_freerdp (VinagreRdpTab *rdp_tab)
- settings->encryption = true;
- settings->encryption_method = ENCRYPTION_METHOD_40BIT | ENCRYPTION_METHOD_128BIT | ENCRYPTION_METHOD_FIPS;
- settings->encryption_level = ENCRYPTION_LEVEL_CLIENT_COMPATIBLE;
-+ settings->AllowUnanouncedOrdersFromServer = true;
-+ settings->BitmapCacheEnabled = true;
- #endif
- #include <freerdp/version.h>
- #if (FREERDP_VERSION_MAJOR == 1 && FREERDP_VERSION_MINOR >= 2 && FREERDP_VERSION_REVISION >= 1) || (FREERDP_VERSION_MAJOR == 2)
+-
+ return TRUE;
+ }
+
+--
+GitLab
+
diff -Nru vinagre-3.22.0/debian/patches/0004-fix-FreeRDP-API-usage.patch vinagre-3.22.0/debian/patches/0004-fix-FreeRDP-API-usage.patch
--- vinagre-3.22.0/debian/patches/0004-fix-FreeRDP-API-usage.patch 2021-02-26 02:35:40.000000000 -0700
+++ vinagre-3.22.0/debian/patches/0004-fix-FreeRDP-API-usage.patch 2024-05-08 15:08:31.000000000 -0600
@@ -10,18 +10,19 @@
plugins/rdp/vinagre-rdp-tab.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
---- a/plugins/rdp/vinagre-rdp-tab.c
-+++ b/plugins/rdp/vinagre-rdp-tab.c
-@@ -70,6 +70,8 @@
- gboolean scaling;
- double scale;
+Index: vinagre/plugins/rdp/vinagre-rdp-tab.c
+===================================================================
+--- vinagre.orig/plugins/rdp/vinagre-rdp-tab.c
++++ vinagre/plugins/rdp/vinagre-rdp-tab.c
+@@ -62,6 +62,7 @@ struct _VinagreRdpTabPrivate
double offset_x, offset_y;
-+
+
+ guint authentication_attempts;
+ gboolean is_connected;
};
G_DEFINE_TYPE (VinagreRdpTab, vinagre_rdp_tab, VINAGRE_TYPE_TAB)
-@@ -178,8 +180,9 @@
+@@ -170,8 +171,9 @@ vinagre_rdp_tab_dispose (GObject *object
if (priv->freerdp_session)
{
@@ -33,7 +34,7 @@
freerdp_context_free (priv->freerdp_session);
g_clear_pointer (&priv->freerdp_session, freerdp_free);
}
-@@ -584,6 +587,12 @@
+@@ -556,6 +558,12 @@ frdp_post_connect (freerdp *instance)
return TRUE;
}
@@ -46,17 +47,17 @@
static gboolean
update (gpointer user_data)
{
-@@ -1065,6 +1074,7 @@
+@@ -978,6 +986,7 @@ init_freerdp (VinagreRdpTab *rdp_tab)
priv->freerdp_session = freerdp_new ();
priv->freerdp_session->PreConnect = frdp_pre_connect;
priv->freerdp_session->PostConnect = frdp_post_connect;
+ priv->freerdp_session->PostDisconnect = frdp_post_disconnect;
priv->freerdp_session->Authenticate = frdp_authenticate;
priv->freerdp_session->VerifyCertificate = frdp_certificate_verify;
- #if HAVE_FREERDP_1_1
-@@ -1199,6 +1209,7 @@
- /* Run FreeRDP session */
- success = freerdp_connect (priv->freerdp_session);
+ priv->freerdp_session->VerifyChangedCertificate = frdp_changed_certificate_verify;
+@@ -1111,6 +1120,7 @@ open_freerdp (VinagreRdpTab *rdp_tab)
+ }
+ while (!success && !cancelled && authentication_errors < 3);
+ priv->is_connected = success;
if (!success)
diff -Nru vinagre-3.22.0/debian/patches/freerdp1.patch vinagre-3.22.0/debian/patches/freerdp1.patch
--- vinagre-3.22.0/debian/patches/freerdp1.patch 1969-12-31 17:00:00.000000000 -0700
+++ vinagre-3.22.0/debian/patches/freerdp1.patch 2024-05-08 14:39:50.000000000 -0600
@@ -0,0 +1,26 @@
+From e41759e91f80c8dfebd4424373c7bf201fb10bf9 Mon Sep 17 00:00:00 2001
+From: Guido Aulisi <guido.aulisi at gmail.com>
+Date: Wed, 8 Nov 2017 09:05:16 +0100
+Subject: [PATCH] Let the user cancel the FreeRDP auth dialog
+
+https://gitlab.gnome.org/GNOME/vinagre/merge_requests/2
+---
+ plugins/rdp/vinagre-rdp-tab.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/plugins/rdp/vinagre-rdp-tab.c b/plugins/rdp/vinagre-rdp-tab.c
+index b731f9b..5b98c24 100644
+--- a/plugins/rdp/vinagre-rdp-tab.c
++++ b/plugins/rdp/vinagre-rdp-tab.c
+@@ -1218,7 +1218,7 @@ open_freerdp (VinagreRdpTab *rdp_tab)
+ init_freerdp (rdp_tab);
+ }
+ }
+- while (!success && authentication_errors < 3);
++ while (!success && !cancelled && authentication_errors < 3);
+
+ if (!success)
+ {
+--
+2.26.2
+
diff -Nru vinagre-3.22.0/debian/patches/freerdp2017.patch vinagre-3.22.0/debian/patches/freerdp2017.patch
--- vinagre-3.22.0/debian/patches/freerdp2017.patch 2020-02-13 04:42:44.000000000 -0700
+++ vinagre-3.22.0/debian/patches/freerdp2017.patch 1969-12-31 17:00:00.000000000 -0700
@@ -1,141 +0,0 @@
-Description: Build with freerdp2
-
-https://bugzilla.gnome.org/show_bug.cgi?id=765444
-
-https://git.archlinux.org/svntogit/packages.git/tree/trunk/freerdp2017.diff?h=packages/vinagre
-
----
- configure.ac | 4 +--
- plugins/rdp/vinagre-rdp-tab.c | 45 ++++++++++++++++++++----------------------
- 2 files changed, 24 insertions(+), 25 deletions(-)
-
---- a/configure.ac
-+++ b/configure.ac
-@@ -58,7 +58,7 @@ AS_IF([test "x$have_ssh" = "xyes"],
- AM_CONDITIONAL([VINAGRE_ENABLE_SSH], [test "x$have_ssh" = "xyes"])
-
- # Whether to enable support for RDP.
--RDP_DEPS="freerdp x11"
-+RDP_DEPS="freerdp2 x11"
- AC_ARG_ENABLE([rdp],
- [AS_HELP_STRING([--disable-rdp],
- [Disable Remote Desktop Protocol (RDP) support])])
-@@ -66,7 +66,7 @@ AC_ARG_ENABLE([rdp],
- AS_IF([test "x$enable_rdp" != "xno"],
- [PKG_CHECK_EXISTS([$RDP_DEPS],
- [have_rdp=yes
-- PKG_CHECK_EXISTS(freerdp >= 1.1,
-+ PKG_CHECK_EXISTS(freerdp2 >= 1.1,
- [AC_DEFINE([HAVE_FREERDP_1_1], [1], [FreeRDP is of version 1.1 or newer])], [])],
- [have_rdp=no])],
- [have_rdp=no])
---- a/plugins/rdp/vinagre-rdp-tab.c
-+++ b/plugins/rdp/vinagre-rdp-tab.c
-@@ -474,16 +474,17 @@ frdp_drawing_area_draw (GtkWidget *area,
- return TRUE;
- }
-
--static void
-+static BOOL
- frdp_begin_paint (rdpContext *context)
- {
- rdpGdi *gdi = context->gdi;
-
- gdi->primary->hdc->hwnd->invalid->null = 1;
- gdi->primary->hdc->hwnd->ninvalid = 0;
-+ return TRUE;
- }
-
--static void
-+static BOOL
- frdp_end_paint (rdpContext *context)
- {
- VinagreRdpTab *rdp_tab = ((frdpContext *) context)->rdp_tab;
-@@ -493,7 +494,7 @@ frdp_end_paint (rdpContext *context)
- gint x, y, w, h;
-
- if (gdi->primary->hdc->hwnd->invalid->null)
-- return;
-+ return TRUE;
-
- x = gdi->primary->hdc->hwnd->invalid->x;
- y = gdi->primary->hdc->hwnd->invalid->y;
-@@ -515,6 +516,7 @@ frdp_end_paint (rdpContext *context)
- {
- gtk_widget_queue_draw_area (priv->display, x, y, w, h);
- }
-+ return TRUE;
- }
-
- static BOOL
-@@ -585,15 +587,7 @@ frdp_post_connect (freerdp *instance)
- rdpGdi *gdi;
- int stride;
-
-- gdi_init (instance,
--#if defined(FREERDP_VERSION_MAJOR) && defined(FREERDP_VERSION_MINOR) && \
-- !(FREERDP_VERSION_MAJOR > 1 || (FREERDP_VERSION_MAJOR == 1 && \
-- FREERDP_VERSION_MINOR >= 2))
-- CLRBUF_24BPP,
--#else
-- CLRBUF_32BPP,
--#endif
-- NULL);
-+ gdi_init (instance, PIXEL_FORMAT_BGRA32);
- gdi = instance->context->gdi;
-
- instance->update->BeginPaint = frdp_begin_paint;
-@@ -969,11 +963,13 @@ frdp_authenticate (freerdp *instance,
- }
- }
-
--static BOOL
-+static DWORD
- frdp_certificate_verify (freerdp *instance,
-- char *subject,
-- char *issuer,
-- char *fingerprint)
-+ const char *common_name,
-+ const char *subject,
-+ const char *issuer,
-+ const char *fingerprint,
-+ BOOL host_mismatch)
- {
- VinagreTab *tab = VINAGRE_TAB (((frdpContext *) instance->context)->rdp_tab);
- GtkBuilder *builder;
-@@ -1003,17 +999,20 @@ frdp_certificate_verify (freerdp *instan
- gtk_widget_hide (dialog);
-
-
-- return response == GTK_RESPONSE_YES;
-+ return (response == GTK_RESPONSE_YES) ? 1 : 0;
- }
-
-
- #if HAVE_FREERDP_1_1
--static BOOL
-+static DWORD
- frdp_changed_certificate_verify (freerdp *instance,
-- char *subject,
-- char *issuer,
-- char *new_fingerprint,
-- char *old_fingerprint)
-+ const char *common_name,
-+ const char *subject,
-+ const char *issuer,
-+ const char *new_fingerprint,
-+ const char *old_subject,
-+ const char *old_issuer,
-+ const char *old_fingerprint)
- {
- VinagreTab *tab = VINAGRE_TAB (((frdpContext *) instance->context)->rdp_tab);
- GtkBuilder *builder;
-@@ -1058,7 +1057,7 @@ frdp_changed_certificate_verify (freerdp
- gtk_widget_hide (dialog);
-
-
-- return response == GTK_RESPONSE_YES;
-+ return (response == GTK_RESPONSE_YES) ? 1 : 0;
- }
- #endif
-
diff -Nru vinagre-3.22.0/debian/patches/freerdp2.patch vinagre-3.22.0/debian/patches/freerdp2.patch
--- vinagre-3.22.0/debian/patches/freerdp2.patch 1969-12-31 17:00:00.000000000 -0700
+++ vinagre-3.22.0/debian/patches/freerdp2.patch 2024-05-08 14:39:50.000000000 -0600
@@ -0,0 +1,226 @@
+From 7f2166ec271a7a2d4ff2360e5cae1ecc8f5b66d6 Mon Sep 17 00:00:00 2001
+From: Ondrej Holy <oholy at redhat.com>
+Date: Thu, 7 Feb 2019 15:53:52 +0100
+Subject: [PATCH] Remove old freerdp compatibility codes
+
+Vinagre is not currently buildable against 1.1, nor 1.0 freerdp versions.
+Let's remove old compatibility codes as they don't work anyway.
+---
+ configure.ac | 4 +-
+ plugins/rdp/vinagre-rdp-tab.c | 92 +----------------------------------
+ 2 files changed, 2 insertions(+), 94 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 5b51a82..2e9f2e1 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -65,9 +65,7 @@ AC_ARG_ENABLE([rdp],
+
+ AS_IF([test "x$enable_rdp" != "xno"],
+ [PKG_CHECK_EXISTS([$RDP_DEPS],
+- [have_rdp=yes
+- PKG_CHECK_EXISTS(freerdp >= 1.1,
+- [AC_DEFINE([HAVE_FREERDP_1_1], [1], [FreeRDP is of version 1.1 or newer])], [])],
++ [have_rdp=yes],
+ [have_rdp=no])],
+ [have_rdp=no])
+
+diff --git a/plugins/rdp/vinagre-rdp-tab.c b/plugins/rdp/vinagre-rdp-tab.c
+index 5b98c24..027866a 100644
+--- a/plugins/rdp/vinagre-rdp-tab.c
++++ b/plugins/rdp/vinagre-rdp-tab.c
+@@ -29,12 +29,7 @@
+ #include <freerdp/types.h>
+ #include <freerdp/freerdp.h>
+ #include <freerdp/gdi/gdi.h>
+-#if HAVE_FREERDP_1_1
+ #include <freerdp/locale/keyboard.h>
+-#else
+-#include <freerdp/kbd/vkcodes.h>
+-#include <gdk/gdkx.h>
+-#endif
+
+ #include "vinagre-rdp-tab.h"
+ #include "vinagre-rdp-connection.h"
+@@ -44,12 +39,6 @@
+
+ #define SELECT_TIMEOUT 50
+
+-#if !HAVE_FREERDP_1_1
+-typedef boolean BOOL;
+-typedef uint8 UINT8;
+-typedef uint16 UINT16;
+-#endif
+-
+ struct _VinagreRdpTabPrivate
+ {
+ freerdp *freerdp_session;
+@@ -524,7 +513,6 @@ frdp_pre_connect (freerdp *instance)
+ {
+ rdpSettings *settings = instance->settings;
+
+-#if HAVE_FREERDP_1_1
+ settings->OrderSupport[NEG_DSTBLT_INDEX] = TRUE;
+ settings->OrderSupport[NEG_PATBLT_INDEX] = TRUE;
+ settings->OrderSupport[NEG_SCRBLT_INDEX] = TRUE;
+@@ -549,32 +537,6 @@ frdp_pre_connect (freerdp *instance)
+ settings->OrderSupport[NEG_POLYGON_CB_INDEX] = FALSE;
+ settings->OrderSupport[NEG_ELLIPSE_SC_INDEX] = FALSE;
+ settings->OrderSupport[NEG_ELLIPSE_CB_INDEX] = FALSE;
+-#else
+- settings->order_support[NEG_DSTBLT_INDEX] = true;
+- settings->order_support[NEG_PATBLT_INDEX] = true;
+- settings->order_support[NEG_SCRBLT_INDEX] = true;
+- settings->order_support[NEG_OPAQUE_RECT_INDEX] = true;
+- settings->order_support[NEG_DRAWNINEGRID_INDEX] = false;
+- settings->order_support[NEG_MULTIDSTBLT_INDEX] = false;
+- settings->order_support[NEG_MULTIPATBLT_INDEX] = false;
+- settings->order_support[NEG_MULTISCRBLT_INDEX] = false;
+- settings->order_support[NEG_MULTIOPAQUERECT_INDEX] = true;
+- settings->order_support[NEG_MULTI_DRAWNINEGRID_INDEX] = false;
+- settings->order_support[NEG_LINETO_INDEX] = true;
+- settings->order_support[NEG_POLYLINE_INDEX] = true;
+- settings->order_support[NEG_MEMBLT_INDEX] = true;
+- settings->order_support[NEG_MEM3BLT_INDEX] = false;
+- settings->order_support[NEG_MEMBLT_V2_INDEX] = true;
+- settings->order_support[NEG_MEM3BLT_V2_INDEX] = false;
+- settings->order_support[NEG_SAVEBITMAP_INDEX] = false;
+- settings->order_support[NEG_GLYPH_INDEX_INDEX] = true;
+- settings->order_support[NEG_FAST_INDEX_INDEX] = true;
+- settings->order_support[NEG_FAST_GLYPH_INDEX] = false;
+- settings->order_support[NEG_POLYGON_SC_INDEX] = false;
+- settings->order_support[NEG_POLYGON_CB_INDEX] = false;
+- settings->order_support[NEG_ELLIPSE_SC_INDEX] = false;
+- settings->order_support[NEG_ELLIPSE_CB_INDEX] = false;
+-#endif
+
+ return TRUE;
+ }
+@@ -587,15 +549,7 @@ frdp_post_connect (freerdp *instance)
+ rdpGdi *gdi;
+ int stride;
+
+- gdi_init (instance,
+-#if defined(FREERDP_VERSION_MAJOR) && defined(FREERDP_VERSION_MINOR) && \
+- !(FREERDP_VERSION_MAJOR > 1 || (FREERDP_VERSION_MAJOR == 1 && \
+- FREERDP_VERSION_MINOR >= 2))
+- CLRBUF_24BPP,
+-#else
+- CLRBUF_32BPP,
+-#endif
+- NULL);
++ gdi_init (instance, CLRBUF_32BPP, NULL);
+ gdi = instance->context->gdi;
+
+ instance->update->BeginPaint = frdp_begin_paint;
+@@ -705,21 +659,15 @@ frdp_key_pressed (GtkWidget *widget,
+ VinagreRdpTab *rdp_tab = (VinagreRdpTab *) user_data;
+ VinagreRdpTabPrivate *priv = rdp_tab->priv;
+ frdpEventKey *frdp_event;
+-#if HAVE_FREERDP_1_1
+ UINT16 scancode;
+-#endif
+
+ frdp_event = g_new0 (frdpEventKey, 1);
+ frdp_event->type = FRDP_EVENT_TYPE_KEY;
+ frdp_event->flags = event->type == GDK_KEY_PRESS ? KBD_FLAGS_DOWN : KBD_FLAGS_RELEASE;
+
+-#if HAVE_FREERDP_1_1
+ scancode = freerdp_keyboard_get_rdp_scancode_from_x11_keycode (event->hardware_keycode);
+ frdp_event->code = RDP_SCANCODE_CODE(scancode);
+ frdp_event->extended = RDP_SCANCODE_EXTENDED(scancode);
+-#else
+- frdp_event->code = freerdp_kbd_get_scancode_by_keycode (event->hardware_keycode, &frdp_event->extended);
+-#endif
+
+ if (frdp_event->extended)
+ frdp_event->flags |= KBD_FLAGS_EXTENDED;
+@@ -972,7 +920,6 @@ frdp_certificate_verify (freerdp *instance,
+ }
+
+
+-#if HAVE_FREERDP_1_1
+ static BOOL
+ frdp_changed_certificate_verify (freerdp *instance,
+ char *subject,
+@@ -1025,7 +972,6 @@ frdp_changed_certificate_verify (freerdp *instance,
+
+ return response == GTK_RESPONSE_YES;
+ }
+-#endif
+
+ static void
+ init_freerdp (VinagreRdpTab *rdp_tab)
+@@ -1053,15 +999,8 @@ init_freerdp (VinagreRdpTab *rdp_tab)
+ priv->freerdp_session->PostConnect = frdp_post_connect;
+ priv->freerdp_session->Authenticate = frdp_authenticate;
+ priv->freerdp_session->VerifyCertificate = frdp_certificate_verify;
+-#if HAVE_FREERDP_1_1
+ priv->freerdp_session->VerifyChangedCertificate = frdp_changed_certificate_verify;
+-#endif
+-
+-#if HAVE_FREERDP_1_1
+ priv->freerdp_session->ContextSize = sizeof (frdpContext);
+-#else
+- priv->freerdp_session->context_size = sizeof (frdpContext);
+-#endif
+
+ freerdp_context_new (priv->freerdp_session);
+ ((frdpContext *) priv->freerdp_session->context)->rdp_tab = rdp_tab;
+@@ -1070,53 +1009,24 @@ init_freerdp (VinagreRdpTab *rdp_tab)
+ settings = priv->freerdp_session->settings;
+
+ /* Security settings */
+-#if HAVE_FREERDP_1_1
+ settings->RdpSecurity = TRUE;
+ settings->TlsSecurity = TRUE;
+ settings->NlaSecurity = TRUE;
+ settings->EncryptionMethods = ENCRYPTION_METHOD_40BIT | ENCRYPTION_METHOD_128BIT | ENCRYPTION_METHOD_FIPS;
+ settings->EncryptionLevel = ENCRYPTION_LEVEL_CLIENT_COMPATIBLE;
+-#else
+- settings->rdp_security = true;
+- settings->tls_security = true;
+- settings->nla_security = true;
+- settings->encryption = true;
+- settings->encryption_method = ENCRYPTION_METHOD_40BIT | ENCRYPTION_METHOD_128BIT | ENCRYPTION_METHOD_FIPS;
+- settings->encryption_level = ENCRYPTION_LEVEL_CLIENT_COMPATIBLE;
+-#endif
+-#include <freerdp/version.h>
+-#if (FREERDP_VERSION_MAJOR == 1 && FREERDP_VERSION_MINOR >= 2 && FREERDP_VERSION_REVISION >= 1) || (FREERDP_VERSION_MAJOR == 2)
+ settings->UseRdpSecurityLayer = FALSE;
+-#else
+- settings->DisableEncryption = FALSE;
+-#endif
+
+ /* Set display size */
+-#if HAVE_FREERDP_1_1
+ settings->DesktopWidth = width;
+ settings->DesktopHeight = height;
+-#else
+- settings->width = width;
+- settings->height = height;
+-#endif
+
+ /* Set hostname */
+-#if HAVE_FREERDP_1_1
+ settings->WindowTitle = g_strdup (hostname);
+ settings->ServerHostname = g_strdup (hostname);
+ settings->ServerPort = port;
+-#else
+- settings->window_title = g_strdup (hostname);
+- settings->hostname = g_strdup (hostname);
+- settings->port = port;
+-#endif
+
+ /* Set keyboard layout */
+-#if HAVE_FREERDP_1_1
+ freerdp_keyboard_init (KBD_US);
+-#else
+- freerdp_kbd_init (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), KBD_US);
+-#endif
+
+ /* Allow font smoothing by default */
+ settings->AllowFontSmoothing = TRUE;
+--
+2.26.2
+
diff -Nru vinagre-3.22.0/debian/patches/freerdp3.patch vinagre-3.22.0/debian/patches/freerdp3.patch
--- vinagre-3.22.0/debian/patches/freerdp3.patch 1969-12-31 17:00:00.000000000 -0700
+++ vinagre-3.22.0/debian/patches/freerdp3.patch 2024-05-08 14:39:50.000000000 -0600
@@ -0,0 +1,149 @@
+From 9d52ad6384ad3ca34a2b32b71fd8c4cbbdbbba42 Mon Sep 17 00:00:00 2001
+From: Ondrej Holy <oholy at redhat.com>
+Date: Thu, 7 Feb 2019 16:26:33 +0100
+Subject: [PATCH] Fix build with freerdp master
+
+FreeRDP 1.2 has never been officially released and is superseded by
+2.0 version. Let's bump the dependency to freerdp2 module and update
+the codes accordingly.
+
+Closes: https://gitlab.gnome.org/GNOME/vinagre/issues/4
+---
+ configure.ac | 3 ++-
+ plugins/rdp/vinagre-rdp-tab.c | 43 +++++++++++++++++++++--------------
+ 2 files changed, 28 insertions(+), 18 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 2e9f2e1..61617f1 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -58,7 +58,8 @@ AS_IF([test "x$have_ssh" = "xyes"],
+ AM_CONDITIONAL([VINAGRE_ENABLE_SSH], [test "x$have_ssh" = "xyes"])
+
+ # Whether to enable support for RDP.
+-RDP_DEPS="freerdp x11"
++RDP_DEPS="freerdp2 x11"
++
+ AC_ARG_ENABLE([rdp],
+ [AS_HELP_STRING([--disable-rdp],
+ [Disable Remote Desktop Protocol (RDP) support])])
+diff --git a/plugins/rdp/vinagre-rdp-tab.c b/plugins/rdp/vinagre-rdp-tab.c
+index 027866a..dcc291d 100644
+--- a/plugins/rdp/vinagre-rdp-tab.c
++++ b/plugins/rdp/vinagre-rdp-tab.c
+@@ -465,16 +465,18 @@ frdp_drawing_area_draw (GtkWidget *area,
+ return TRUE;
+ }
+
+-static void
++static BOOL
+ frdp_begin_paint (rdpContext *context)
+ {
+ rdpGdi *gdi = context->gdi;
+
+ gdi->primary->hdc->hwnd->invalid->null = 1;
+ gdi->primary->hdc->hwnd->ninvalid = 0;
++
++ return TRUE;
+ }
+
+-static void
++static BOOL
+ frdp_end_paint (rdpContext *context)
+ {
+ VinagreRdpTab *rdp_tab = ((frdpContext *) context)->rdp_tab;
+@@ -484,7 +486,7 @@ frdp_end_paint (rdpContext *context)
+ gint x, y, w, h;
+
+ if (gdi->primary->hdc->hwnd->invalid->null)
+- return;
++ return TRUE;
+
+ x = gdi->primary->hdc->hwnd->invalid->x;
+ y = gdi->primary->hdc->hwnd->invalid->y;
+@@ -506,6 +508,8 @@ frdp_end_paint (rdpContext *context)
+ {
+ gtk_widget_queue_draw_area (priv->display, x, y, w, h);
+ }
++
++ return TRUE;
+ }
+
+ static BOOL
+@@ -549,7 +553,7 @@ frdp_post_connect (freerdp *instance)
+ rdpGdi *gdi;
+ int stride;
+
+- gdi_init (instance, CLRBUF_32BPP, NULL);
++ gdi_init (instance, PIXEL_FORMAT_BGRA32);
+ gdi = instance->context->gdi;
+
+ instance->update->BeginPaint = frdp_begin_paint;
+@@ -882,11 +886,13 @@ frdp_authenticate (freerdp *instance,
+ return TRUE;
+ }
+
+-static BOOL
++static DWORD
+ frdp_certificate_verify (freerdp *instance,
+- char *subject,
+- char *issuer,
+- char *fingerprint)
++ const char *common_name,
++ const char *subject,
++ const char *issuer,
++ const char *fingerprint,
++ BOOL host_mismatch)
+ {
+ VinagreTab *tab = VINAGRE_TAB (((frdpContext *) instance->context)->rdp_tab);
+ GtkBuilder *builder;
+@@ -911,21 +917,24 @@ frdp_certificate_verify (freerdp *instance,
+ widget = GTK_WIDGET (gtk_builder_get_object (builder, "certificate_fingerprint"));
+ gtk_label_set_text (GTK_LABEL (widget), fingerprint);
+
++ /* FIXME: Pass host_mismatch to user. */
+
+ response = gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_hide (dialog);
+
+-
+- return response == GTK_RESPONSE_YES;
++ return (response == GTK_RESPONSE_YES) ? 1 : 0;
+ }
+
+
+-static BOOL
++static DWORD
+ frdp_changed_certificate_verify (freerdp *instance,
+- char *subject,
+- char *issuer,
+- char *new_fingerprint,
+- char *old_fingerprint)
++ const char *common_name,
++ const char *subject,
++ const char *issuer,
++ const char *new_fingerprint,
++ const char *old_subject,
++ const char *old_issuer,
++ const char *old_fingerprint)
+ {
+ VinagreTab *tab = VINAGRE_TAB (((frdpContext *) instance->context)->rdp_tab);
+ GtkBuilder *builder;
+@@ -965,12 +974,12 @@ frdp_changed_certificate_verify (freerdp *instance,
+ gtk_widget_hide (label);
+ }
+
++ /* FIXME: Pass old_subject and old_issuer to user. */
+
+ response = gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_hide (dialog);
+
+-
+- return response == GTK_RESPONSE_YES;
++ return (response == GTK_RESPONSE_YES) ? 1 : 0;
+ }
+
+ static void
+--
+2.26.2
+
diff -Nru vinagre-3.22.0/debian/patches/freerdp4.patch vinagre-3.22.0/debian/patches/freerdp4.patch
--- vinagre-3.22.0/debian/patches/freerdp4.patch 1969-12-31 17:00:00.000000000 -0700
+++ vinagre-3.22.0/debian/patches/freerdp4.patch 2024-05-08 14:39:50.000000000 -0600
@@ -0,0 +1,203 @@
+From 1790370c3c2765076077e8b36a19543698e27172 Mon Sep 17 00:00:00 2001
+From: Ondrej Holy <oholy at redhat.com>
+Date: Thu, 7 Feb 2019 17:16:33 +0100
+Subject: [PATCH] Pass new certificate info to user
+
+The freerdp2 certificate callbacks contain more parameters. Let's
+pass some of them to user also.
+---
+ data/vinagre.ui | 80 ++++++++++++++++++++++++++++++-----
+ plugins/rdp/vinagre-rdp-tab.c | 26 ++++--------
+ 2 files changed, 79 insertions(+), 27 deletions(-)
+
+diff --git a/data/vinagre.ui b/data/vinagre.ui
+index 3135336..d7ce258 100644
+--- a/data/vinagre.ui
++++ b/data/vinagre.ui
+@@ -885,7 +885,7 @@ Do you trust the new certificate?</property>
+ <property name="vexpand">True</property>
+ <property name="xalign">0</property>
+ <property name="xpad">12</property>
+- <property name="label" translatable="yes" comments="Subject of the certificate.">Subject:</property>
++ <property name="label" translatable="yes" comments="Subject of the certificate.">New subject:</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+@@ -901,7 +901,7 @@ Do you trust the new certificate?</property>
+ <property name="vexpand">True</property>
+ <property name="xalign">0</property>
+ <property name="xpad">12</property>
+- <property name="label" translatable="yes" comments="Issuer of the certificate.">Issuer:</property>
++ <property name="label" translatable="yes" comments="Issuer of the certificate.">New issuer:</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+@@ -927,7 +927,55 @@ Do you trust the new certificate?</property>
+ </packing>
+ </child>
+ <child>
+- <object class="GtkLabel" id="certificate_changed_subject">
++ <object class="GtkLabel">
++ <property name="visible">True</property>
++ <property name="can_focus">False</property>
++ <property name="vexpand">True</property>
++ <property name="xalign">0</property>
++ <property name="xpad">12</property>
++ <property name="label" translatable="yes" comments="Subject of the old certificate.">Old subject:</property>
++ </object>
++ <packing>
++ <property name="left_attach">0</property>
++ <property name="top_attach">3</property>
++ <property name="width">1</property>
++ <property name="height">1</property>
++ </packing>
++ </child>
++ <child>
++ <object class="GtkLabel">
++ <property name="visible">True</property>
++ <property name="can_focus">False</property>
++ <property name="vexpand">True</property>
++ <property name="xalign">0</property>
++ <property name="xpad">12</property>
++ <property name="label" translatable="yes" comments="Issuer of the old certificate.">Old issuer:</property>
++ </object>
++ <packing>
++ <property name="left_attach">0</property>
++ <property name="top_attach">4</property>
++ <property name="width">1</property>
++ <property name="height">1</property>
++ </packing>
++ </child>
++ <child>
++ <object class="GtkLabel">
++ <property name="visible">True</property>
++ <property name="can_focus">False</property>
++ <property name="vexpand">True</property>
++ <property name="xalign">0</property>
++ <property name="xpad">12</property>
++ <property name="label" translatable="yes" comments="Fingerprint of the old certificate.">Old fingerprint:</property>
++ </object>
++ <packing>
++ <property name="left_attach">0</property>
++ <property name="top_attach">5</property>
++ <property name="width">1</property>
++ <property name="height">1</property>
++ </packing>
++ </child>
++ <child>
++ <object class="GtkLabel" id="certificate_changed_new_subject">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+@@ -942,7 +990,7 @@ Do you trust the new certificate?</property>
+ </packing>
+ </child>
+ <child>
+- <object class="GtkLabel" id="certificate_changed_issuer">
++ <object class="GtkLabel" id="certificate_changed_new_issuer">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+@@ -972,21 +1020,33 @@ Do you trust the new certificate?</property>
+ </packing>
+ </child>
+ <child>
+- <object class="GtkLabel" id="certificate_changed_old_fingerprint_label">
++ <object class="GtkLabel" id="certificate_changed_old_subject">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+- <property name="vexpand">True</property>
++ <property name="hexpand">True</property>
+ <property name="xalign">0</property>
+- <property name="xpad">12</property>
+- <property name="label" translatable="yes" comments="Fingerprint of the old certificate.">Old fingerprint:</property>
+ </object>
+ <packing>
+- <property name="left_attach">0</property>
++ <property name="left_attach">1</property>
+ <property name="top_attach">3</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
++ <child>
++ <object class="GtkLabel" id="certificate_changed_old_issuer">
++ <property name="visible">True</property>
++ <property name="can_focus">False</property>
++ <property name="hexpand">True</property>
++ <property name="xalign">0</property>
++ </object>
++ <packing>
++ <property name="left_attach">1</property>
++ <property name="top_attach">4</property>
++ <property name="width">1</property>
++ <property name="height">1</property>
++ </packing>
++ </child>
+ <child>
+ <object class="GtkLabel" id="certificate_changed_old_fingerprint">
+ <property name="visible">True</property>
+@@ -997,7 +1057,7 @@ Do you trust the new certificate?</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+- <property name="top_attach">3</property>
++ <property name="top_attach">5</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+diff --git a/plugins/rdp/vinagre-rdp-tab.c b/plugins/rdp/vinagre-rdp-tab.c
+index dcc291d..4e0f937 100644
+--- a/plugins/rdp/vinagre-rdp-tab.c
++++ b/plugins/rdp/vinagre-rdp-tab.c
+@@ -940,7 +940,6 @@ frdp_changed_certificate_verify (freerdp *instance,
+ GtkBuilder *builder;
+ GtkWidget *dialog;
+ GtkWidget *widget;
+- GtkWidget *label;
+ gint response;
+
+ builder = vinagre_utils_get_builder ();
+@@ -951,30 +950,23 @@ frdp_changed_certificate_verify (freerdp *instance,
+ _("Connect"), GTK_RESPONSE_YES, NULL);
+ gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_YES);
+
+- widget = GTK_WIDGET (gtk_builder_get_object (builder, "certificate_changed_subject"));
++ widget = GTK_WIDGET (gtk_builder_get_object (builder, "certificate_changed_new_subject"));
+ gtk_label_set_text (GTK_LABEL (widget), subject);
+
+- widget = GTK_WIDGET (gtk_builder_get_object (builder, "certificate_changed_issuer"));
++ widget = GTK_WIDGET (gtk_builder_get_object (builder, "certificate_changed_new_issuer"));
+ gtk_label_set_text (GTK_LABEL (widget), issuer);
+
+ widget = GTK_WIDGET (gtk_builder_get_object (builder, "certificate_changed_new_fingerprint"));
+ gtk_label_set_text (GTK_LABEL (widget), new_fingerprint);
+
+- widget = GTK_WIDGET (gtk_builder_get_object (builder, "certificate_changed_old_fingerprint"));
+- label = GTK_WIDGET (gtk_builder_get_object (builder, "certificate_changed_old_fingerprint_label"));
+- if (old_fingerprint != NULL && old_fingerprint[0] != '\0')
+- {
+- gtk_label_set_text (GTK_LABEL (widget), old_fingerprint);
+- gtk_widget_show (widget);
+- gtk_widget_show (label);
+- }
+- else
+- {
+- gtk_widget_hide (widget);
+- gtk_widget_hide (label);
+- }
++ widget = GTK_WIDGET (gtk_builder_get_object (builder, "certificate_changed_old_subject"));
++ gtk_label_set_text (GTK_LABEL (widget), old_subject);
+
+- /* FIXME: Pass old_subject and old_issuer to user. */
++ widget = GTK_WIDGET (gtk_builder_get_object (builder, "certificate_changed_old_issuer"));
++ gtk_label_set_text (GTK_LABEL (widget), old_issuer);
++
++ widget = GTK_WIDGET (gtk_builder_get_object (builder, "certificate_changed_old_fingerprint"));
++ gtk_label_set_text (GTK_LABEL (widget), old_fingerprint);
+
+ response = gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_hide (dialog);
+--
+2.26.2
+
diff -Nru vinagre-3.22.0/debian/patches/freerdp5.patch vinagre-3.22.0/debian/patches/freerdp5.patch
--- vinagre-3.22.0/debian/patches/freerdp5.patch 1969-12-31 17:00:00.000000000 -0700
+++ vinagre-3.22.0/debian/patches/freerdp5.patch 2024-05-08 14:39:50.000000000 -0600
@@ -0,0 +1,49 @@
+From 81f235f9bdb0e46f362e14811fbe83759232ba37 Mon Sep 17 00:00:00 2001
+From: Ondrej Holy <oholy at redhat.com>
+Date: Fri, 8 Feb 2019 10:25:20 +0100
+Subject: [PATCH] Fix crashes when certificate is not accepted
+
+Vinagre crashes if the certificate is not accepted by user, because
+`emit_delayed_signal` is invoked after the rdp tab disposal. Let's
+remove the idle source during disposal to prevent the crash.
+---
+ plugins/rdp/vinagre-rdp-tab.c | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/plugins/rdp/vinagre-rdp-tab.c b/plugins/rdp/vinagre-rdp-tab.c
+index 4e0f937..bbb8adf 100644
+--- a/plugins/rdp/vinagre-rdp-tab.c
++++ b/plugins/rdp/vinagre-rdp-tab.c
+@@ -46,6 +46,7 @@ struct _VinagreRdpTabPrivate
+ cairo_surface_t *surface;
+ GQueue *events;
+
++ guint intialized_id;
+ guint update_id;
+ guint button_press_handler_id;
+ guint button_release_handler_id;
+@@ -181,6 +182,12 @@ vinagre_rdp_tab_dispose (GObject *object)
+ g_clear_pointer (&priv->events, g_queue_free);
+ }
+
++ if (priv->intialized_id > 0)
++ {
++ g_source_remove (rdp_tab->priv->intialized_id);
++ rdp_tab->priv->intialized_id = 0;
++ }
++
+ if (priv->update_id > 0)
+ {
+ g_source_remove (rdp_tab->priv->update_id);
+@@ -239,7 +246,7 @@ vinagre_rdp_tab_constructed (GObject *object)
+ setup_toolbar (rdp_tab);
+ open_freerdp (rdp_tab);
+
+- g_idle_add ((GSourceFunc) emit_delayed_signal, object);
++ rdp_tab->priv->intialized_id = g_idle_add ((GSourceFunc) emit_delayed_signal, object);
+ }
+
+ static void
+--
+2.26.2
+
diff -Nru vinagre-3.22.0/debian/patches/series vinagre-3.22.0/debian/patches/series
--- vinagre-3.22.0/debian/patches/series 2021-02-26 02:34:20.000000000 -0700
+++ vinagre-3.22.0/debian/patches/series 2024-05-08 14:56:08.000000000 -0600
@@ -1,7 +1,9 @@
-0001-Revert-Improve-FreeRDP-authentication-failure-handli.patch
-0002-Revert-Store-credentials-for-RDP.patch
-freerdp2017.patch
131d151cb02245f84918f9ba5b3ef055758bcf61.patch
+freerdp1.patch
+freerdp2.patch
+freerdp3.patch
+freerdp4.patch
+freerdp5.patch
gcc-10.patch
0003-fix-hangs-with-recent-FreeRDP-version.patch
0004-fix-FreeRDP-API-usage.patch
More information about the pkg-gnome-maintainers
mailing list