rpms/gkrellm/F-12 gkrellm-2.3.2-ssl-threadsafety.patch, NONE, 1.1 gkrellm.spec, 1.24, 1.25

Hans de Goede jwrdegoede at fedoraproject.org
Thu Dec 3 08:58:56 UTC 2009


Author: jwrdegoede

Update of /cvs/extras/rpms/gkrellm/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv30219

Modified Files:
	gkrellm.spec 
Added Files:
	gkrellm-2.3.2-ssl-threadsafety.patch 
Log Message:
* Fri Nov 27 2009 Hans de Goede <hdegoede at redhat.com> 2.3.2-7
- Fix crash when using multiple simap/spop mailboxes (#541824)


gkrellm-2.3.2-ssl-threadsafety.patch:
 mail.c |   33 ++++++++++++++++++++++++++++++---
 1 file changed, 30 insertions(+), 3 deletions(-)

--- NEW FILE gkrellm-2.3.2-ssl-threadsafety.patch ---
diff -up gkrellm-2.3.2/src/mail.c~ gkrellm-2.3.2/src/mail.c
--- gkrellm-2.3.2/src/mail.c~	2008-10-04 02:33:37.000000000 +0200
+++ gkrellm-2.3.2/src/mail.c	2009-11-27 11:50:31.000000000 +0100
@@ -306,6 +306,21 @@ static gint		anim_frame,
 
 static gint		style_id;
 
+#ifdef HAVE_SSL
+#ifndef HAVE_GNUTLS
+static GMutex		**ssl_locks;
+
+static void
+ssl_locking_cb(int mode, int n, const char *file, int line)
+	{
+	if (mode & CRYPTO_LOCK)
+		g_mutex_lock(ssl_locks[n]);
+	else
+		g_mutex_unlock(ssl_locks[n]);
+	}
+#endif
+#endif
+
   /* This may be called from gkrellm_sys_main_init()
   */
 void
@@ -750,9 +765,6 @@ ssl_negotiate(ConnInfo *conn, Mailbox *m
 	{
 	SSL_METHOD	*ssl_method;
 
-	SSLeay_add_ssl_algorithms();
-	SSL_load_error_strings();
-
 	if (mbox->account->use_ssl == SSL_TRANSPORT)
 		ssl_method = SSLv23_client_method();
 	else
@@ -4246,6 +4258,12 @@ static GkrellmMonitor	monitor_mail =
 GkrellmMonitor *
 gkrellm_init_mail_monitor(void)
 	{
+#ifdef HAVE_SSL
+#ifndef HAVE_GNUTLS
+	int i, num_locks = CRYPTO_num_locks();
+#endif
+#endif
+
 	monitor_mail.name = _(monitor_mail.name);
 	enable_mail = TRUE;
 	show_tooltip = TRUE;
@@ -4266,6 +4284,15 @@ gkrellm_init_mail_monitor(void)
 #ifdef HAVE_GNUTLS
 	gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
 	gnutls_global_init();
+#else
+#ifdef HAVE_SSL
+	SSL_load_error_strings();
+	SSL_library_init();
+	ssl_locks = g_new(GMutex *, num_locks);
+	for (i = 0; i < num_locks; i++)
+		ssl_locks[i] = g_mutex_new();
+	CRYPTO_set_locking_callback(ssl_locking_cb);
+#endif
 #endif
 
 	mail_fetch = g_new0(Mailbox, 1);


Index: gkrellm.spec
===================================================================
RCS file: /cvs/extras/rpms/gkrellm/F-12/gkrellm.spec,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -p -r1.24 -r1.25
--- gkrellm.spec	21 Aug 2009 13:31:37 -0000	1.24
+++ gkrellm.spec	3 Dec 2009 08:58:55 -0000	1.25
@@ -1,6 +1,6 @@
 Name:           gkrellm
 Version:        2.3.2
-Release:        6%{?dist}
+Release:        7%{?dist}
 Summary:        Multiple stacked system monitors in one process
 Group:          Applications/System
 License:        GPLv3+
@@ -13,6 +13,7 @@ Patch1:         gkrellm-2.1.28-config.pa
 Patch2:         gkrellm-2.2.4-sansfont.patch
 Patch3:         gkrellm-2.2.7-width.patch
 Patch4:         gkrellm-2.3.1-netdb.patch
+Patch5:         gkrellm-2.3.2-ssl-threadsafety.patch
 BuildRequires:  gtk2-devel openssl-devel libSM-devel desktop-file-utils gettext
 BuildRequires:  lm_sensors-devel
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -61,6 +62,7 @@ Development files for the GNU Krell Moni
 %patch2 -p1 -z .sansfont
 %patch3 -p1 -z .width
 %patch4 -p1 -z .netdb
+%patch5 -p1 -z .ssl
 
 for i in gkrellmd.1 gkrellm.1 README Changelog Changelog-plugins.html; do
    sed -i -e "s@/usr/lib/gkrellm2/plugins@%{_libdir}/gkrellm2/plugins@" $i
@@ -167,6 +169,9 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Fri Nov 27 2009 Hans de Goede <hdegoede at redhat.com> 2.3.2-7
+- Fix crash when using multiple simap/spop mailboxes (#541824)
+
 * Fri Aug 21 2009 Tomas Mraz <tmraz at redhat.com> - 2.3.2-6
 - rebuilt with new openssl
 




More information about the scm-commits mailing list