pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc



Module Name:    pkgsrc
Committed By:   hauke
Date:           Thu Sep  5 12:39:57 UTC 2019

Modified Files:
        pkgsrc/databases/tdb: Makefile distinfo
        pkgsrc/net/samba4: Makefile distinfo
        pkgsrc/net/samba4/patches: patch-buildtools_wafsamba_wscript
Added Files:
        pkgsrc/databases/tdb/patches: patch-common_mutex.c
        pkgsrc/net/samba4/patches: patch-lib_pthreadpool_pthreadpool.c
            patch-lib_tdb_common_mutex.c patch-lib_tevent_tevent.c
            patch-lib_tevent_tevent__threads.c patch-lib_util_smb__threads.h
            patch-lib_util_tfork.c patch-nsswitch_stress-nss-libwbclient.c
            patch-source3_libsmb_pylibsmb.c patch-source3_smbd_process.c
            patch-source4_heimdal_include_heim__threads.h
            patch-third__party_socket__wrapper_socket__wrapper.c

Log Message:
Solarish pthreads expect mutex datastructures to be properly zeroed
out, unlike the Linux implementation, which upstream mainly
targets. This leads to "tdb_open_ex: tdb_mutex_init failed for
/var/samba/lock/gencache.tdb: Device busy" errors, described in
<https://illumos.topicbox.com/groups/developer/T28dcabf2f69cac04>.

Illumos kernel code attempted to mitigate the problem as of
<https://www.illumos.org/issues/9959>, but the changes have yet to
show up in releases.

The patches originate from
<https://github.com/oposs/pkg.oetiker.ch-build/blob/master/build/samba4/patches/pthread_mutex_init>,
modified appropriately.

Tested on omniosce r151030.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 pkgsrc/databases/tdb/Makefile
cvs rdiff -u -r1.21 -r1.22 pkgsrc/databases/tdb/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/databases/tdb/patches/patch-common_mutex.c
cvs rdiff -u -r1.79 -r1.80 pkgsrc/net/samba4/Makefile
cvs rdiff -u -r1.35 -r1.36 pkgsrc/net/samba4/distinfo
cvs rdiff -u -r1.1 -r1.2 \
    pkgsrc/net/samba4/patches/patch-buildtools_wafsamba_wscript
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/net/samba4/patches/patch-lib_pthreadpool_pthreadpool.c \
    pkgsrc/net/samba4/patches/patch-lib_tdb_common_mutex.c \
    pkgsrc/net/samba4/patches/patch-lib_tevent_tevent.c \
    pkgsrc/net/samba4/patches/patch-lib_tevent_tevent__threads.c \
    pkgsrc/net/samba4/patches/patch-lib_util_smb__threads.h \
    pkgsrc/net/samba4/patches/patch-lib_util_tfork.c \
    pkgsrc/net/samba4/patches/patch-nsswitch_stress-nss-libwbclient.c \
    pkgsrc/net/samba4/patches/patch-source3_libsmb_pylibsmb.c \
    pkgsrc/net/samba4/patches/patch-source3_smbd_process.c \
    pkgsrc/net/samba4/patches/patch-source4_heimdal_include_heim__threads.h \
    pkgsrc/net/samba4/patches/patch-third__party_socket__wrapper_socket__wrapper.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/databases/tdb/Makefile
diff -u pkgsrc/databases/tdb/Makefile:1.40 pkgsrc/databases/tdb/Makefile:1.41
--- pkgsrc/databases/tdb/Makefile:1.40  Fri Aug 23 10:49:14 2019
+++ pkgsrc/databases/tdb/Makefile       Thu Sep  5 12:39:56 2019
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.40 2019/08/23 10:49:14 adam Exp $
+# $NetBSD: Makefile,v 1.41 2019/09/05 12:39:56 hauke Exp $
 
 DISTNAME=      tdb-1.4.2
+PKGREVISION=   1
 CATEGORIES=    databases
 MASTER_SITES=  http://www.samba.org/ftp/tdb/
 

Index: pkgsrc/databases/tdb/distinfo
diff -u pkgsrc/databases/tdb/distinfo:1.21 pkgsrc/databases/tdb/distinfo:1.22
--- pkgsrc/databases/tdb/distinfo:1.21  Fri Aug 23 10:49:14 2019
+++ pkgsrc/databases/tdb/distinfo       Thu Sep  5 12:39:56 2019
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.21 2019/08/23 10:49:14 adam Exp $
+$NetBSD: distinfo,v 1.22 2019/09/05 12:39:56 hauke Exp $
 
 SHA1 (tdb-1.4.2.tar.gz) = 9a6e51cde16a2400b76448c4e7de2f87656477a2
 RMD160 (tdb-1.4.2.tar.gz) = 8dac17b4b272a4df61b385b4ba3c297e1bcbb6c7
@@ -7,3 +7,4 @@ Size (tdb-1.4.2.tar.gz) = 706236 bytes
 SHA1 (patch-buildtools_wafsamba_samba__conftests.py) = 50ff76f5b085f770751ca8bb93c8544cfdcd40d9
 SHA1 (patch-buildtools_wafsamba_samba__install.py) = d801340617da325e3bb70a90350e45cc8e383c2d
 SHA1 (patch-buildtools_wafsamba_samba__utils.py) = 0a587421870c1974175fadbb02dde215f35938f2
+SHA1 (patch-common_mutex.c) = 4dc326c8a5e7230be8ab3ff9b6cc5548df90430f

Index: pkgsrc/net/samba4/Makefile
diff -u pkgsrc/net/samba4/Makefile:1.79 pkgsrc/net/samba4/Makefile:1.80
--- pkgsrc/net/samba4/Makefile:1.79     Wed Sep  4 08:15:32 2019
+++ pkgsrc/net/samba4/Makefile  Thu Sep  5 12:39:56 2019
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.79 2019/09/04 08:15:32 taca Exp $
+# $NetBSD: Makefile,v 1.80 2019/09/05 12:39:56 hauke Exp $
 
 DISTNAME=      samba-4.10.8
+PKGREVISION=   1
 CATEGORIES=    net
 MASTER_SITES=  https://download.samba.org/pub/samba/stable/
 MAINTAINER=    pkgsrc-users%NetBSD.org@localhost

Index: pkgsrc/net/samba4/distinfo
diff -u pkgsrc/net/samba4/distinfo:1.35 pkgsrc/net/samba4/distinfo:1.36
--- pkgsrc/net/samba4/distinfo:1.35     Tue Sep  3 19:11:58 2019
+++ pkgsrc/net/samba4/distinfo  Thu Sep  5 12:39:56 2019
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.35 2019/09/03 19:11:58 adam Exp $
+$NetBSD: distinfo,v 1.36 2019/09/05 12:39:56 hauke Exp $
 
 SHA1 (samba-4.10.8.tar.gz) = e0fafe34e7205c4f9ab54f96ab2ee72d1b9cfaca
 RMD160 (samba-4.10.8.tar.gz) = ee2f253b30e1ecdd796c8c92f3d7c5fae7ec0694
@@ -8,16 +8,27 @@ SHA1 (patch-buildtools_wafsamba_samba__c
 SHA1 (patch-buildtools_wafsamba_samba__install.py) = d801340617da325e3bb70a90350e45cc8e383c2d
 SHA1 (patch-buildtools_wafsamba_samba__pidl.py) = a7cc41a55ce032c3fe1e0b660f88fa7871710e0e
 SHA1 (patch-buildtools_wafsamba_samba__utils.py) = 0a587421870c1974175fadbb02dde215f35938f2
-SHA1 (patch-buildtools_wafsamba_wscript) = 5604936a825675647157331df2333f4237c611f5
+SHA1 (patch-buildtools_wafsamba_wscript) = 117fb13f5266dc90568b18ffa8faa34a45bc94c5
 SHA1 (patch-docs-xml_wscript__build) = 5aa5cbf61882604b7ec9d19f0cd1537a23705ad0
 SHA1 (patch-dynconfig_wscript) = 1858e5fcca913f21aa3e7868d9760b9c40c9f5c4
 SHA1 (patch-lib_param_loadparm.h) = 0216b69d33d1e17260a446e11bee764116c52b18
+SHA1 (patch-lib_pthreadpool_pthreadpool.c) = c29490473063d6bdbe5c50780a21bf2869ae959f
 SHA1 (patch-lib_replace_wscript) = 2a754e7310850b376d5881b82a8467041284fce9
+SHA1 (patch-lib_tdb_common_mutex.c) = 12dbcf870e6ba17ef7f92a8ce7f0b7462f820232
+SHA1 (patch-lib_tevent_tevent.c) = 4a20506e2bfbab85bad664299b884575326e73fd
+SHA1 (patch-lib_tevent_tevent__threads.c) = 14867888dd0b7c4613914752ab368c39bfdbb943
 SHA1 (patch-lib_tevent_wscript) = fbbe2024096b57d651d90064f53489a974db9d7a
+SHA1 (patch-lib_util_smb__threads.h) = 93bbc4276ad927ad6faf305af093064f47c09254
+SHA1 (patch-lib_util_tfork.c) = cd70dcff5f2ce94ffe642e0f029f03ee07dff27d
 SHA1 (patch-libcli_dns_wscript__build) = 40e6f864e2fb1b6abb198f1a51bb2c95bc8c6fb2
+SHA1 (patch-nsswitch_stress-nss-libwbclient.c) = bf327282a59aefeeb2d6bf9eccf9b3a832033066
 SHA1 (patch-nsswitch_winbind__nss__netbsd.c) = 71d8acd0aa4c297d75555fba650461c778495caa
 SHA1 (patch-nsswitch_wscript__build) = e8a6251e031ffa13d6347fade8891f7afd65d3eb
+SHA1 (patch-source3_libsmb_pylibsmb.c) = 50c3aaecf345449e02642e387eeac3dd7043e77a
+SHA1 (patch-source3_smbd_process.c) = 532d2426b9bd2a215d133bc489741558aa07f849
 SHA1 (patch-source4_dsdb_samdb_ldb__modules_wscript__build__server) = c322cf56995192039fa22548d6d6e50641c4c796
 SHA1 (patch-source4_heimdal__build_roken.h) = ee535f8e7cc46a3487d95bc859438c476a88fe60
 SHA1 (patch-source4_heimdal__build_wscript__configure) = 82f9da47f7dc4c3fc29f93b1e9829a1a3b54c095
+SHA1 (patch-source4_heimdal_include_heim__threads.h) = c93e0c80790ea2045333822c80e66d371bf2249c
 SHA1 (patch-source4_scripting_wsript_build) = bd4feddcaadf1c3d2d25eb7914e7b5843e4e9511
+SHA1 (patch-third__party_socket__wrapper_socket__wrapper.c) = 0cc01c932f21e9f6219fb9d204e6fdf3682938f8

Index: pkgsrc/net/samba4/patches/patch-buildtools_wafsamba_wscript
diff -u pkgsrc/net/samba4/patches/patch-buildtools_wafsamba_wscript:1.1 pkgsrc/net/samba4/patches/patch-buildtools_wafsamba_wscript:1.2
--- pkgsrc/net/samba4/patches/patch-buildtools_wafsamba_wscript:1.1     Tue May 26 15:11:26 2015
+++ pkgsrc/net/samba4/patches/patch-buildtools_wafsamba_wscript Thu Sep  5 12:39:56 2019
@@ -1,4 +1,4 @@
-$NetBSD: patch-buildtools_wafsamba_wscript,v 1.1 2015/05/26 15:11:26 jperkin Exp $
+$NetBSD: patch-buildtools_wafsamba_wscript,v 1.2 2019/09/05 12:39:56 hauke Exp $
 
 Define _POSIX_PTHREAD_SEMANTICS on SunOS to pick up re-entrant functions.
 
@@ -8,7 +8,7 @@ Define _POSIX_PTHREAD_SEMANTICS on SunOS
      conf.DEFINE('_GNU_SOURCE', 1, add_to_cflags=True)
      conf.DEFINE('_XOPEN_SOURCE_EXTENDED', 1, add_to_cflags=True)
  
-+    # Use POSIX getpwnam_r and friends.
++    # Use POSIX getpwnam_r and friends.
 +    if conf.env['SYSTEM_UNAME_SYSNAME'] == 'SunOS':
 +        conf.DEFINE('_POSIX_PTHREAD_SEMANTICS', 1, add_to_cflags=True)
 +

Added files:

Index: pkgsrc/databases/tdb/patches/patch-common_mutex.c
diff -u /dev/null pkgsrc/databases/tdb/patches/patch-common_mutex.c:1.1
--- /dev/null   Thu Sep  5 12:39:57 2019
+++ pkgsrc/databases/tdb/patches/patch-common_mutex.c   Thu Sep  5 12:39:56 2019
@@ -0,0 +1,63 @@
+$NetBSD: patch-common_mutex.c,v 1.1 2019/09/05 12:39:56 hauke Exp $
+
+On SunOS (OpenSolaris), pthread_mutex_init() expects a zeroed-out
+mutex data structure
+
+--- common/mutex.c.orig        2017-04-28 08:57:26.000000000 +0000
++++ common/mutex.c
+@@ -567,6 +567,7 @@ int tdb_mutex_init(struct tdb_context *t
+       }
+       m = tdb->mutexes;
+ 
++        memset(&ma, 0, sizeof(pthread_mutexattr_t));
+       ret = pthread_mutexattr_init(&ma);
+       if (ret != 0) {
+               goto fail_munmap;
+@@ -587,6 +588,7 @@ int tdb_mutex_init(struct tdb_context *t
+       for (i=0; i<tdb->hash_size+1; i++) {
+               pthread_mutex_t *chain = &m->hashchains[i];
+ 
++                memset(chain, 0, sizeof(pthread_mutex_t));
+               ret = pthread_mutex_init(chain, &ma);
+               if (ret != 0) {
+                       goto fail;
+@@ -595,6 +597,7 @@ int tdb_mutex_init(struct tdb_context *t
+ 
+       m->allrecord_lock = F_UNLCK;
+ 
++        memset(&m->allrecord_mutex, 0, sizeof(pthread_mutex_t));
+       ret = pthread_mutex_init(&m->allrecord_mutex, &ma);
+       if (ret != 0) {
+               goto fail;
+@@ -672,6 +675,7 @@ static bool tdb_mutex_locking_supported(
+ 
+       initialized = true;
+ 
++      memset(&ma, 0, sizeof(pthread_mutexattr_t));
+       ret = pthread_mutexattr_init(&ma);
+       if (ret != 0) {
+               return false;
+@@ -688,6 +692,7 @@ static bool tdb_mutex_locking_supported(
+       if (ret != 0) {
+               goto cleanup_ma;
+       }
++        memset(&m, 0, sizeof(pthread_mutex_t));
+       ret = pthread_mutex_init(&m, &ma);
+       if (ret != 0) {
+               goto cleanup_ma;
+@@ -868,6 +873,7 @@ _PUBLIC_ bool tdb_runtime_check_for_robu
+               goto cleanup;
+       }
+ 
++        memset(&ma, 0, sizeof(pthread_mutexattr_t));
+       ret = pthread_mutexattr_init(&ma);
+       if (ret != 0) {
+               goto cleanup;
+@@ -885,6 +891,7 @@ _PUBLIC_ bool tdb_runtime_check_for_robu
+       if (ret != 0) {
+               goto cleanup;
+       }
++        memset(ptr, 0, sizeof(pthread_mutex_t));
+       ret = pthread_mutex_init(ptr, &ma);
+       if (ret != 0) {
+               goto cleanup;

Index: pkgsrc/net/samba4/patches/patch-lib_pthreadpool_pthreadpool.c
diff -u /dev/null pkgsrc/net/samba4/patches/patch-lib_pthreadpool_pthreadpool.c:1.1
--- /dev/null   Thu Sep  5 12:39:57 2019
+++ pkgsrc/net/samba4/patches/patch-lib_pthreadpool_pthreadpool.c       Thu Sep  5 12:39:56 2019
@@ -0,0 +1,23 @@
+$NetBSD: patch-lib_pthreadpool_pthreadpool.c,v 1.1 2019/09/05 12:39:56 hauke Exp $
+
+On SunOS (OpenSolaris), pthread_mutex_init() expects a zeroed-out
+mutex data structure
+    
+--- lib/pthreadpool/pthreadpool.c.orig 2019-01-15 10:07:00.000000000 +0000
++++ lib/pthreadpool/pthreadpool.c
+@@ -153,6 +153,7 @@ int pthreadpool_init(unsigned max_thread
+ 
+       pool->head = pool->num_jobs = 0;
+ 
++      memset(&pool->mutex, 0, sizeof(pthread_mutex_t));
+       ret = pthread_mutex_init(&pool->mutex, NULL);
+       if (ret != 0) {
+               free(pool->jobs);
+@@ -168,6 +169,7 @@ int pthreadpool_init(unsigned max_thread
+               return ret;
+       }
+ 
++      memset(&pool->fork_mutex, 0, sizeof(pthread_mutex_t));  
+       ret = pthread_mutex_init(&pool->fork_mutex, NULL);
+       if (ret != 0) {
+               pthread_cond_destroy(&pool->condvar);
Index: pkgsrc/net/samba4/patches/patch-lib_tdb_common_mutex.c
diff -u /dev/null pkgsrc/net/samba4/patches/patch-lib_tdb_common_mutex.c:1.1
--- /dev/null   Thu Sep  5 12:39:57 2019
+++ pkgsrc/net/samba4/patches/patch-lib_tdb_common_mutex.c      Thu Sep  5 12:39:56 2019
@@ -0,0 +1,63 @@
+$NetBSD: patch-lib_tdb_common_mutex.c,v 1.1 2019/09/05 12:39:56 hauke Exp $
+
+On SunOS (OpenSolaris), pthread_mutex_init() expects a zeroed-out
+mutex data structure
+    
+--- lib/tdb/common/mutex.c.orig        2019-01-15 10:07:00.000000000 +0000
++++ lib/tdb/common/mutex.c
+@@ -567,6 +567,7 @@ int tdb_mutex_init(struct tdb_context *t
+       }
+       m = tdb->mutexes;
+ 
++      memset(&ma, 0, sizeof(pthread_mutexattr_t));
+       ret = pthread_mutexattr_init(&ma);
+       if (ret != 0) {
+               goto fail_munmap;
+@@ -587,6 +588,7 @@ int tdb_mutex_init(struct tdb_context *t
+       for (i=0; i<tdb->hash_size+1; i++) {
+               pthread_mutex_t *chain = &m->hashchains[i];
+ 
++              memset(chain, 0, sizeof(pthread_mutex_t));
+               ret = pthread_mutex_init(chain, &ma);
+               if (ret != 0) {
+                       goto fail;
+@@ -595,6 +597,7 @@ int tdb_mutex_init(struct tdb_context *t
+ 
+       m->allrecord_lock = F_UNLCK;
+ 
++      memset(&m->allrecord_mutex, 0, sizeof(pthread_mutex_t));
+       ret = pthread_mutex_init(&m->allrecord_mutex, &ma);
+       if (ret != 0) {
+               goto fail;
+@@ -672,6 +675,7 @@ static bool tdb_mutex_locking_supported(
+ 
+       initialized = true;
+ 
++      memset(&ma, 0, sizeof(pthread_mutexattr_t));
+       ret = pthread_mutexattr_init(&ma);
+       if (ret != 0) {
+               return false;
+@@ -688,6 +692,7 @@ static bool tdb_mutex_locking_supported(
+       if (ret != 0) {
+               goto cleanup_ma;
+       }
++      memset(&m, 0, sizeof(pthread_mutex_t));
+       ret = pthread_mutex_init(&m, &ma);
+       if (ret != 0) {
+               goto cleanup_ma;
+@@ -868,6 +873,7 @@ _PUBLIC_ bool tdb_runtime_check_for_robu
+               goto cleanup;
+       }
+ 
++      memset(&ma, 0, sizeof(pthread_mutexattr_t));
+       ret = pthread_mutexattr_init(&ma);
+       if (ret != 0) {
+               goto cleanup;
+@@ -885,6 +891,7 @@ _PUBLIC_ bool tdb_runtime_check_for_robu
+       if (ret != 0) {
+               goto cleanup;
+       }
++      memset(ptr, 0, sizeof(pthread_mutex_t));
+       ret = pthread_mutex_init(ptr, &ma);
+       if (ret != 0) {
+               goto cleanup;
Index: pkgsrc/net/samba4/patches/patch-lib_tevent_tevent.c
diff -u /dev/null pkgsrc/net/samba4/patches/patch-lib_tevent_tevent.c:1.1
--- /dev/null   Thu Sep  5 12:39:57 2019
+++ pkgsrc/net/samba4/patches/patch-lib_tevent_tevent.c Thu Sep  5 12:39:56 2019
@@ -0,0 +1,15 @@
+$NetBSD: patch-lib_tevent_tevent.c,v 1.1 2019/09/05 12:39:56 hauke Exp $
+
+On SunOS (OpenSolaris), pthread_mutex_init() expects a zeroed-out
+mutex data structure
+    
+--- lib/tevent/tevent.c.orig   2019-01-15 10:07:00.000000000 +0000
++++ lib/tevent/tevent.c
+@@ -423,6 +423,7 @@ static int tevent_common_context_constru
+               return ret;
+       }
+ 
++      memset(&ev->scheduled_mutex, 0, sizeof(pthread_mutex_t));
+       ret = pthread_mutex_init(&ev->scheduled_mutex, NULL);
+       if (ret != 0) {
+               return ret;
Index: pkgsrc/net/samba4/patches/patch-lib_tevent_tevent__threads.c
diff -u /dev/null pkgsrc/net/samba4/patches/patch-lib_tevent_tevent__threads.c:1.1
--- /dev/null   Thu Sep  5 12:39:57 2019
+++ pkgsrc/net/samba4/patches/patch-lib_tevent_tevent__threads.c        Thu Sep  5 12:39:56 2019
@@ -0,0 +1,23 @@
+$NetBSD: patch-lib_tevent_tevent__threads.c,v 1.1 2019/09/05 12:39:56 hauke Exp $
+
+On SunOS (OpenSolaris), pthread_mutex_init() expects a zeroed-out
+mutex data structure
+    
+--- lib/tevent/tevent_threads.c.orig   2019-01-15 10:07:00.000000000 +0000
++++ lib/tevent/tevent_threads.c
+@@ -234,6 +234,7 @@ struct tevent_thread_proxy *tevent_threa
+               return NULL;
+       }
+ 
++      memset(&tp->mutex, 0, sizeof(pthread_mutex_t));
+       ret = pthread_mutex_init(&tp->mutex, NULL);
+       if (ret != 0) {
+               goto fail;
+@@ -439,6 +440,7 @@ struct tevent_threaded_context *tevent_t
+       }
+       tctx->event_ctx = ev;
+ 
++      memset(&tctx->event_ctx_mutex, 0, sizeof(pthread_mutex_t));
+       ret = pthread_mutex_init(&tctx->event_ctx_mutex, NULL);
+       if (ret != 0) {
+               TALLOC_FREE(tctx);
Index: pkgsrc/net/samba4/patches/patch-lib_util_smb__threads.h
diff -u /dev/null pkgsrc/net/samba4/patches/patch-lib_util_smb__threads.h:1.1
--- /dev/null   Thu Sep  5 12:39:57 2019
+++ pkgsrc/net/samba4/patches/patch-lib_util_smb__threads.h     Thu Sep  5 12:39:56 2019
@@ -0,0 +1,15 @@
+$NetBSD: patch-lib_util_smb__threads.h,v 1.1 2019/09/05 12:39:56 hauke Exp $
+
+On SunOS (OpenSolaris), pthread_mutex_init() expects a zeroed-out
+mutex data structure
+    
+--- lib/util/smb_threads.h.orig        2019-01-15 10:07:00.000000000 +0000
++++ lib/util/smb_threads.h
+@@ -66,6 +66,7 @@ static int smb_create_mutex_pthread(cons
+       if (!pmut) { \
+               return ENOMEM; \
+       } \
++      memset(pmut, 0, sizeof(pthread_mutex_t)); \
+       pthread_mutex_init(pmut, NULL); \
+       *pplock = (void *)pmut; \
+       return 0; \
Index: pkgsrc/net/samba4/patches/patch-lib_util_tfork.c
diff -u /dev/null pkgsrc/net/samba4/patches/patch-lib_util_tfork.c:1.1
--- /dev/null   Thu Sep  5 12:39:57 2019
+++ pkgsrc/net/samba4/patches/patch-lib_util_tfork.c    Thu Sep  5 12:39:56 2019
@@ -0,0 +1,15 @@
+$NetBSD: patch-lib_util_tfork.c,v 1.1 2019/09/05 12:39:56 hauke Exp $
+
+On SunOS (OpenSolaris), pthread_mutex_init() expects a zeroed-out
+mutex data structure
+    
+--- lib/util/tfork.c.orig      2019-01-15 10:07:00.000000000 +0000
++++ lib/util/tfork.c
+@@ -281,6 +281,7 @@ static void tfork_global_initialize(void
+       ret = pthread_key_create(&tfork_global_key, tfork_global_destructor);
+       assert(ret == 0);
+ 
++      memset(&signal_state.mutex, 0, sizeof(pthread_mutex_t));
+       ret = pthread_mutex_init(&signal_state.mutex, NULL);
+       assert(ret == 0);
+ 
Index: pkgsrc/net/samba4/patches/patch-nsswitch_stress-nss-libwbclient.c
diff -u /dev/null pkgsrc/net/samba4/patches/patch-nsswitch_stress-nss-libwbclient.c:1.1
--- /dev/null   Thu Sep  5 12:39:57 2019
+++ pkgsrc/net/samba4/patches/patch-nsswitch_stress-nss-libwbclient.c   Thu Sep  5 12:39:56 2019
@@ -0,0 +1,15 @@
+$NetBSD: patch-nsswitch_stress-nss-libwbclient.c,v 1.1 2019/09/05 12:39:56 hauke Exp $
+
+On SunOS (OpenSolaris), pthread_mutex_init() expects a zeroed-out
+mutex data structure
+    
+--- nsswitch/stress-nss-libwbclient.c.orig     2019-01-15 10:07:00.000000000 +0000
++++ nsswitch/stress-nss-libwbclient.c
+@@ -118,6 +118,7 @@ int main(int argc, char *argv[])
+ 
+       state.username = argv[1];
+       state.timeout = time(NULL) + RUNTIME;
++      memset(&state.lock, 0, sizeof(pthread_mutex_t));
+       rc = pthread_mutex_init(&state.lock, NULL);
+       if (rc != 0) {
+               fprintf(stderr,
Index: pkgsrc/net/samba4/patches/patch-source3_libsmb_pylibsmb.c
diff -u /dev/null pkgsrc/net/samba4/patches/patch-source3_libsmb_pylibsmb.c:1.1
--- /dev/null   Thu Sep  5 12:39:57 2019
+++ pkgsrc/net/samba4/patches/patch-source3_libsmb_pylibsmb.c   Thu Sep  5 12:39:56 2019
@@ -0,0 +1,15 @@
+$NetBSD: patch-source3_libsmb_pylibsmb.c,v 1.1 2019/09/05 12:39:56 hauke Exp $
+
+On SunOS (OpenSolaris), pthread_mutex_init() expects a zeroed-out
+mutex data structure
+    
+--- source3/libsmb/pylibsmb.c.orig     2019-05-07 08:38:21.000000000 +0000
++++ source3/libsmb/pylibsmb.c
+@@ -285,6 +285,7 @@ static int py_tevent_cond_wait(struct py
+ {
+       int ret, result;
+ 
++      memset(&cond->mutex, 0, sizeof(pthread_mutex_t));
+       result = pthread_mutex_init(&cond->mutex, NULL);
+       if (result != 0) {
+               goto fail;
Index: pkgsrc/net/samba4/patches/patch-source3_smbd_process.c
diff -u /dev/null pkgsrc/net/samba4/patches/patch-source3_smbd_process.c:1.1
--- /dev/null   Thu Sep  5 12:39:57 2019
+++ pkgsrc/net/samba4/patches/patch-source3_smbd_process.c      Thu Sep  5 12:39:56 2019
@@ -0,0 +1,23 @@
+$NetBSD: patch-source3_smbd_process.c,v 1.1 2019/09/05 12:39:56 hauke Exp $
+
+On SunOS (OpenSolaris), pthread_mutex_init() expects a zeroed-out
+mutex data structure
+    
+--- source3/smbd/process.c.orig        2019-01-15 10:07:00.000000000 +0000
++++ source3/smbd/process.c
+@@ -3342,6 +3342,7 @@ bool fork_echo_handler(struct smbXsrv_co
+                       goto fail;
+               }
+ 
++              memset(&a, 0, sizeof(pthread_mutexattr_t));
+               res = pthread_mutexattr_init(&a);
+               if (res != 0) {
+                       DEBUG(1, ("pthread_mutexattr_init failed: %s\n",
+@@ -3369,6 +3370,7 @@ bool fork_echo_handler(struct smbXsrv_co
+                       pthread_mutexattr_destroy(&a);
+                       goto fail;
+               }
++              memset(xconn->smb1.echo_handler.socket_mutex, 0, sizeof(pthread_mutex_t));
+               res = pthread_mutex_init(xconn->smb1.echo_handler.socket_mutex,
+                                        &a);
+               pthread_mutexattr_destroy(&a);
Index: pkgsrc/net/samba4/patches/patch-source4_heimdal_include_heim__threads.h
diff -u /dev/null pkgsrc/net/samba4/patches/patch-source4_heimdal_include_heim__threads.h:1.1
--- /dev/null   Thu Sep  5 12:39:57 2019
+++ pkgsrc/net/samba4/patches/patch-source4_heimdal_include_heim__threads.h     Thu Sep  5 12:39:56 2019
@@ -0,0 +1,16 @@
+$NetBSD: patch-source4_heimdal_include_heim__threads.h,v 1.1 2019/09/05 12:39:56 hauke Exp $
+
+On SunOS (OpenSolaris), pthread_mutex_init() expects a zeroed-out
+mutex data structure
+    
+--- source4/heimdal/include/heim_threads.h.orig        2019-01-15 10:07:00.000000000 +0000
++++ source4/heimdal/include/heim_threads.h
+@@ -87,7 +87,7 @@
+ 
+ #define HEIMDAL_MUTEX pthread_mutex_t
+ #define HEIMDAL_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER
+-#define HEIMDAL_MUTEX_init(m) pthread_mutex_init(m, NULL)
++#define HEIMDAL_MUTEX_init(m) memset(m, 0, sizeof(pthread_mutex_t));pthread_mutex_init(m, NULL)
+ #define HEIMDAL_MUTEX_lock(m) pthread_mutex_lock(m)
+ #define HEIMDAL_MUTEX_unlock(m) pthread_mutex_unlock(m)
+ #define HEIMDAL_MUTEX_destroy(m) pthread_mutex_destroy(m)
Index: pkgsrc/net/samba4/patches/patch-third__party_socket__wrapper_socket__wrapper.c
diff -u /dev/null pkgsrc/net/samba4/patches/patch-third__party_socket__wrapper_socket__wrapper.c:1.1
--- /dev/null   Thu Sep  5 12:39:57 2019
+++ pkgsrc/net/samba4/patches/patch-third__party_socket__wrapper_socket__wrapper.c      Thu Sep  5 12:39:56 2019
@@ -0,0 +1,23 @@
+$NetBSD: patch-third__party_socket__wrapper_socket__wrapper.c,v 1.1 2019/09/05 12:39:56 hauke Exp $
+
+On SunOS (OpenSolaris), pthread_mutex_init() expects a zeroed-out
+mutex data structure
+    
+--- third_party/socket_wrapper/socket_wrapper.c.orig   2019-01-15 10:07:01.000000000 +0000
++++ third_party/socket_wrapper/socket_wrapper.c
+@@ -1329,6 +1329,7 @@ static int socket_wrapper_init_mutex(pth
+       pthread_mutexattr_t ma;
+       int ret;
+ 
++      memset(ma, 0, sizeof(pthread_mutexattr_t));
+       ret = pthread_mutexattr_init(&ma);
+       if (ret != 0) {
+               return ret;
+@@ -1339,6 +1340,7 @@ static int socket_wrapper_init_mutex(pth
+               goto done;
+       }
+ 
++      memset(m, 0, sizeof(pthread_mutex_t));
+       ret = pthread_mutex_init(m, &ma);
+ 
+ done:



Home | Main Index | Thread Index | Old Index