rpms/autofs/devel autofs-5.0.5-add-sasl-mutex-callbacks.patch, NONE, 1.1 autofs.spec, 1.301, 1.302
Ian Kent
iankent at fedoraproject.org
Tue Feb 23 05:41:32 UTC 2010
Author: iankent
Update of /cvs/pkgs/rpms/autofs/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv16353
Modified Files:
autofs.spec
Added Files:
autofs-5.0.5-add-sasl-mutex-callbacks.patch
Log Message:
* Tue Feb 23 2010 Ian Kent <kpnt at redhat.com> - 1:5.0.5-21
- add missing sasl mutex callbacks.
autofs-5.0.5-add-sasl-mutex-callbacks.patch:
CHANGELOG | 1
modules/cyrus-sasl.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 58 insertions(+)
--- NEW FILE autofs-5.0.5-add-sasl-mutex-callbacks.patch ---
autofs-5.0.5 - add sasl mutex callbacks
From: Ian Kent <raven at themaw.net>
We missed the fact that Cyrus SASL requires the user to provide mutex
handling functions when being used in a threaded environment.
Original patch contributed by Kazuhiro Kikuchi (of Fujitsu), slightly
modified by myself.
---
CHANGELOG | 1
modules/cyrus-sasl.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 58 insertions(+)
--- autofs-5.0.5.orig/CHANGELOG
+++ autofs-5.0.5/CHANGELOG
@@ -22,6 +22,7 @@
- fix disable timeout.
- fix strdup() return value check (Leonardo Chiquitto).
- fix reconnect get base dn.
+- add missing sasl mutex callbacks.
03/09/2009 autofs-5.0.5
-----------------------
--- autofs-5.0.5.orig/modules/cyrus-sasl.c
+++ autofs-5.0.5/modules/cyrus-sasl.c
@@ -944,12 +944,69 @@ void autofs_sasl_dispose(struct lookup_c
}
}
+static void *sasl_mutex_new(void)
+{
+ pthread_mutex_t* mutex;
+
+ mutex = malloc(sizeof(pthread_mutex_t));
+ if (!mutex)
+ return 0;
+
+ pthread_mutex_init(mutex, NULL);
+
+ return (void *) mutex;
+}
+
+static int sasl_mutex_lock(void *mutex __attribute__((unused)))
+{
+ int rc;
+
+ if (!mutex)
+ return SASL_FAIL;
+
+ rc = pthread_mutex_lock((pthread_mutex_t *) mutex);
+
+ return (rc==0 ? SASL_OK : SASL_FAIL);
+}
+
+static int sasl_mutex_unlock(void *mutex __attribute__((unused)))
+{
+ int rc;
+
+ if (!mutex)
+ return SASL_FAIL;
+
+ rc = pthread_mutex_unlock((pthread_mutex_t *) mutex);
+
+ return (rc==0 ? SASL_OK : SASL_FAIL);
+}
+
+static void sasl_mutex_dispose(void *mutex __attribute__((unused)))
+{
+ int rc;
+
+ if (!mutex)
+ return;
+
+ rc = pthread_mutex_destroy((pthread_mutex_t *) mutex);
+ if (rc == 0)
+ free(mutex);
+
+ return;
+}
+
/*
* Initialize the sasl callbacks, which increments the global
* use counter.
*/
int autofs_sasl_client_init(unsigned logopt)
{
+
+ sasl_set_mutex(sasl_mutex_new,
+ sasl_mutex_lock,
+ sasl_mutex_unlock,
+ sasl_mutex_dispose);
+
/* Start up Cyrus SASL--only needs to be done at library load. */
if (sasl_client_init(callbacks) != SASL_OK) {
error(logopt, "sasl_client_init failed");
Index: autofs.spec
===================================================================
RCS file: /cvs/pkgs/rpms/autofs/devel/autofs.spec,v
retrieving revision 1.301
retrieving revision 1.302
diff -u -p -r1.301 -r1.302
--- autofs.spec 11 Feb 2010 02:43:51 -0000 1.301
+++ autofs.spec 23 Feb 2010 05:41:31 -0000 1.302
@@ -4,7 +4,7 @@
Summary: A tool for automatically mounting and unmounting filesystems
Name: autofs
Version: 5.0.5
-Release: 19%{?dist}
+Release: 21%{?dist}
Epoch: 1
License: GPLv2+
Group: System Environment/Daemons
@@ -32,6 +32,7 @@ Patch19: autofs-5.0.5-fix-random-selecti
Patch20: autofs-5.0.5-fix-disable-timeout.patch
Patch21: autofs-5.0.5-fix-strdup-return-value-check.patch
Patch22: autofs-5.0.5-fix-reconnect-get-base-dn.patch
+Patch23: autofs-5.0.5-add-sasl-mutex-callbacks.patch
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: autoconf, hesiod-devel, openldap-devel, bison, flex, libxml2-devel, cyrus-sasl-devel, openssl-devel module-init-tools util-linux nfs-utils e2fsprogs libtirpc-devel
Requires: kernel >= 2.6.17
@@ -95,6 +96,7 @@ echo %{version}-%{release} > .version
%patch20 -p1
%patch21 -p1
%patch22 -p1
+%patch23 -p1
%build
#CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=/usr --libdir=%{_libdir}
@@ -147,6 +149,9 @@ fi
%{_libdir}/autofs/
%changelog
+* Tue Feb 23 2010 Ian Kent <kpnt at redhat.com> - 1:5.0.5-21
+- add missing sasl mutex callbacks.
+
* Thu Feb 11 2010 Ian Kent <kpnt at redhat.com> - 1:5.0.5-19
- fix segfault upon reconnect cannot find valid base dn.
More information about the scm-commits
mailing list