#! /bin/sh /usr/share/dpatch/dpatch-run ## 0016_sasl_set_mutex.dpatch by ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: No description. @DPATCH@ diff -urNad cyrus-sasl2-2.1.22.dfsg1~/lib/common.c cyrus-sasl2-2.1.22.dfsg1/lib/common.c --- cyrus-sasl2-2.1.22.dfsg1~/lib/common.c 2008-09-20 13:57:42.000000000 +0200 +++ cyrus-sasl2-2.1.22.dfsg1/lib/common.c 2008-09-20 13:57:58.000000000 +0200 @@ -153,6 +153,13 @@ void sasl_set_mutex(sasl_mutex_alloc_t *n, sasl_mutex_lock_t *l, sasl_mutex_unlock_t *u, sasl_mutex_free_t *d) { + /* only one call is permitted, if one of the function has already + * been changed we are in trouble in a subsequent call */ + if ((_sasl_mutex_utils.alloc != &sasl_mutex_alloc) || + (_sasl_mutex_utils.lock != &sasl_mutex_lock) || + (_sasl_mutex_utils.unlock != &sasl_mutex_unlock) || + (_sasl_mutex_utils.free != &sasl_mutex_free)) + return; _sasl_mutex_utils.alloc=n; _sasl_mutex_utils.lock=l; _sasl_mutex_utils.unlock=u;