Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes to cyrus-sasl library mutexes #447

Closed
quanah opened this issue Jul 14, 2017 · 0 comments
Closed

Fixes to cyrus-sasl library mutexes #447

quanah opened this issue Jul 14, 2017 · 0 comments

Comments

@quanah
Copy link
Contributor

quanah commented Jul 14, 2017

This comes from Debian 0006_library_mutexes.patch

Author: Fabian Fagerholm <fabbe@debian.org>
Description: Exact description unknown; make sure mutex-related code works.
--- cyrus-sasl2.orig/lib/common.c
+++ cyrus-sasl2/lib/common.c
@@ -818,7 +818,7 @@ int _sasl_common_init(sasl_global_callba
     result = sasl_canonuser_add_plugin("INTERNAL", internal_canonuser_init);
     if(result != SASL_OK) return result;

-    if (!free_mutex) {
+    if (!free_mutex || free_mutex == 0x1) {
        free_mutex = sasl_MUTEX_ALLOC();
     }
     if (!free_mutex) return SASL_FAIL;
@@ -838,6 +838,11 @@ void sasl_dispose(sasl_conn_t **pconn)

   /* serialize disposes. this is necessary because we can't
      dispose of conn->mutex if someone else is locked on it */
+
+  if (!free_mutex || free_mutex == 0x1)
+    free_mutex = sasl_MUTEX_ALLOC();
+  if (!free_mutex) return SASL_FAIL;
+
   result = sasl_MUTEX_LOCK(free_mutex);
   if (result!=SASL_OK) return;

Needs review, I'm not familiar enough with the code.

ksmurchison added a commit that referenced this issue Sep 6, 2017
brong pushed a commit that referenced this issue Jan 29, 2018
brong pushed a commit that referenced this issue Jan 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants