rpms/gtk-vnc/F-12 gtk-vnc-0.3.10-gcrypt-threading.patch, NONE, 1.1 gtk-vnc.spec, 1.42, 1.43

Daniel P. Berrange berrange at fedoraproject.org
Thu Dec 17 18:29:38 UTC 2009


Author: berrange

Update of /cvs/pkgs/rpms/gtk-vnc/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv27340

Modified Files:
	gtk-vnc.spec 
Added Files:
	gtk-vnc-0.3.10-gcrypt-threading.patch 
Log Message:
Fix gcrypt threading initialization (rhbz #537489)

gtk-vnc-0.3.10-gcrypt-threading.patch:
 gvnc.c |   46 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

--- NEW FILE gtk-vnc-0.3.10-gcrypt-threading.patch ---
commit 90225c7981ae7a1586e6dbf136ba34b0e1ec8cae
Author: Daniel P. Berrange <berrange at redhat.com>
Date:   Thu Dec 17 18:23:19 2009 +0000

    Initialize gcrypt threading callbacks
    
    If GTK has threading enabled, we must be sure to enable gcrypt
    threading callbacks too for safety

diff --git a/src/gvnc.c b/src/gvnc.c
index 307bbfe..c42fd6e 100644
--- a/src/gvnc.c
+++ b/src/gvnc.c
@@ -781,6 +781,47 @@ static void gvnc_debug_gnutls_log(int level, const char* str) {
 }
 #endif
 
+
+static int gvnc_tls_mutex_init (void **priv)
+{                                                                             \
+    GMutex *lock = NULL;
+    lock = g_mutex_new();
+    *priv = lock;
+    return 0;
+}
+
+static int gvnc_tls_mutex_destroy(void **priv)
+{
+    GMutex *lock = *priv;
+    g_mutex_free(lock);
+    return 0;
+}
+
+static int gvnc_tls_mutex_lock(void **priv)
+{
+    GMutex *lock = *priv;
+    g_mutex_lock(lock);
+    return 0;
+}
+
+static int gvnc_tls_mutex_unlock(void **priv)
+{
+    GMutex *lock = *priv;
+    g_mutex_unlock(lock);
+    return 0;
+}
+
+static struct gcry_thread_cbs gvnc_thread_impl = {
+    (GCRY_THREAD_OPTION_PTHREAD | (GCRY_THREAD_OPTION_VERSION << 8)),
+    NULL,
+    gvnc_tls_mutex_init,
+    gvnc_tls_mutex_destroy,
+    gvnc_tls_mutex_lock,
+    gvnc_tls_mutex_unlock,
+    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
+};
+
+
 static gboolean gvnc_tls_initialize(void)
 {
 	static int tlsinitialized = 0;
@@ -788,6 +829,11 @@ static gboolean gvnc_tls_initialize(void)
 	if (tlsinitialized)
 		return TRUE;
 
+	if (g_thread_supported()) {
+		gcry_control(GCRYCTL_SET_THREAD_CBS, &gvnc_thread_impl);
+		gcry_check_version(NULL);
+	}
+
 	if (gnutls_global_init () < 0)
 		return FALSE;
 


Index: gtk-vnc.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gtk-vnc/F-12/gtk-vnc.spec,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -p -r1.42 -r1.43
--- gtk-vnc.spec	21 Oct 2009 01:27:39 -0000	1.42
+++ gtk-vnc.spec	17 Dec 2009 18:29:38 -0000	1.43
@@ -7,11 +7,11 @@
 Summary: A GTK widget for VNC clients
 Name: gtk-vnc
 Version: 0.3.10
-Release: 1%{?dist}
+Release: 2%{?dist}
 License: LGPLv2+
 Group: Development/Libraries
 Source: http://ftp.gnome.org/pub/GNOME/sources/%{name}/0.3/%{name}-%{version}.tar.bz2
-
+Patch1: %{name}-%{version}-gcrypt-threading.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 URL: http://live.gnome.org/gtk-vnc
 BuildRequires: gtk2-devel pygtk2-devel python-devel zlib-devel
@@ -69,6 +69,7 @@ browsers.
 
 %prep
 %setup -q
+%patch1 -p1
 
 %build
 %if %{with_plugin}
@@ -124,6 +125,9 @@ rm -fr %{buildroot}
 %endif
 
 %changelog
+* Thu Dec 17 2009 Daniel P. Berrange <berrange at redhat.com> - 0.3.10-2
+- Fix gcrypt threading initialization (rhbz #537489)
+
 * Tue Oct 20 2009 Matthias Clasen <mclaesn at redhat.com> - 0.3.10-1
 - Update to 0.3.10
 




More information about the scm-commits mailing list