1 # This patch is related to https://www.illumos.org/issues/9959.
2 # For some reason the underlying OS does not memset the mutex to zero.
3 # Therefore this patch does it.
5 diff -Naur samba-4.10.2.orig/lib/tdb/common/mutex.c samba-4.10.2/lib/tdb/common/mutex.c
6 --- samba-4.10.2.orig/lib/tdb/common/mutex.c 2019-04-20 07:46:16.548548581 +0000
7 +++ samba-4.10.2/lib/tdb/common/mutex.c 2019-04-21 11:12:25.665046799 +0000
9 for (i=0; i<tdb->hash_size+1; i++) {
10 pthread_mutex_t *chain = &m->hashchains[i];
12 + (void) memset(chain, 0, sizeof(*chain));
13 ret = pthread_mutex_init(chain, &ma);
18 m->allrecord_lock = F_UNLCK;
20 + (void) memset(&m->allrecord_mutex, 0, sizeof(m->allrecord_mutex));
21 ret = pthread_mutex_init(&m->allrecord_mutex, &ma);
28 + (void) memset(ptr, 0, sizeof(*ptr));
29 ret = pthread_mutex_init(ptr, &ma);