On 10/27/14 14:44, Giovanni Bechis wrote:
> On 10/27/14 13:00, Stuart Henderson wrote:
>> Try this diff.
>>
>> Untested but if my theory as to why it's breaking is correct, it
>> should work.
>>
>> Only the dlopen()'d libdriver_mysql.so modules are linked with
>> -lpthread. This isn't enough on OpenBSD, the programs calling them
>> also need linking that way.
>>
>> LD_PRELOAD didn't work because Dovecot cleans the environment that
>> it passes to child processes (specifically, whichever of lda, auth,
>> dict, *-login etc. actually call dlopen to load the mysql module).
>>
>> Diff is done this way for expediency, to go upstream it would at
>> least want the patch moving to configure.ac and checking the OS.
>>
> ok for me, probably courier-authlib,-mysql needs something similar,
> I will double check soon.
>  Cheers
>   Giovanni 
> 
Diff to unbreak courier-authlib attached, ok ?
 Cheers
  Giovanni
Index: Makefile
===================================================================
RCS file: /var/cvs/ports/mail/courier-authlib/Makefile,v
retrieving revision 1.48
diff -u -p -r1.48 Makefile
--- Makefile	15 Sep 2014 15:18:16 -0000	1.48
+++ Makefile	27 Oct 2014 17:55:39 -0000
@@ -7,14 +7,17 @@ COMMENT-pgsql=		pgsql authentication mod
 COMMENT-userdb=		userdb authentication module for courier-authLib
 
 DISTNAME=		courier-authlib-0.66.1
+REVISION=		1
 PKGNAME-main=		${DISTNAME}
 PKGNAME-ldap=		${DISTNAME:S/lib-/lib-ldap-/}
 PKGNAME-mysql=		${DISTNAME:S/lib-/lib-mysql-/}
 PKGNAME-pgsql=		${DISTNAME:S/lib-/lib-pgsql-/}
 PKGNAME-userdb=		${DISTNAME:S/lib-/lib-userdb-/}
 
-REVISION=		0
-REVISION-mysql=		1
+REVISION-mysql=		2
+REVISION-ldap=		0
+REVISION-pgsql=		0
+REVISION-userdb=	0
 
 SHARED_LIBS +=  courierauth          1.0      # .0.0
 SHARED_LIBS +=  courierauthsasl      1.0      # .0.0
@@ -42,7 +45,7 @@ EXTRACT_SUFX=		.tar.bz2
 USE_GMAKE=		Yes
 CONFIGURE_STYLE=	gnu
 
-CONFIGURE_ENV=		LIBS="-L${LOCALBASE}/lib" \
+CONFIGURE_ENV=		LIBS="-L${LOCALBASE}/lib -lpthread" \
 			LDFLAGS="-L${LOCALBASE}/lib" \
 			CPPFLAGS="-I${LOCALBASE}/include" \
 			ac_cv_lib_db_dbopen=no \
@@ -82,28 +85,30 @@ MULTI_PACKAGES=		-main -ldap -mysql -pgs
 PSEUDO_FLAVORS=		no_ldap no_mysql no_pgsql no_userdb
 FLAVOR?=
 
-WANTLIB-main=		c ltdl sqlite3
+WANTLIB-main=		c ltdl pthread sqlite3
 
 LIB_DEPENDS-main=	devel/libtool,-ltdl
 
 WANTLIB-ldap=		crypto ssl courierauthcommon courierauth \
-			ldap-2.4 lber-2.4 sasl2
+			ldap-2.4 lber-2.4 pthread sasl2
 RUN_DEPENDS-ldap=
 LIB_DEPENDS-ldap=	${BUILD_PKGPATH} \
 			databases/openldap \
 			security/cyrus-sasl2
 
-WANTLIB-mysql=		crypto m ssl z courierauthcommon courierauth mysqlclient
+WANTLIB-mysql=		crypto m ssl z courierauthcommon courierauth \
+			mysqlclient pthread stdc++
 RUN_DEPENDS-mysql=
 LIB_DEPENDS-mysql=	${BUILD_PKGPATH} \
 			databases/mariadb
 
-WANTLIB-pgsql=		m courierauthcommon courierauth pq crypto ssl
+WANTLIB-pgsql=		courierauth courierauthcommon crypto m pq pthread ssl
 RUN_DEPENDS-pgsql=
 LIB_DEPENDS-pgsql=	${BUILD_PKGPATH} \
 			databases/postgresql
 
-WANTLIB-userdb=		c courierauthcommon courierauth gdbm>=3 ${MODGETTEXT_WANTLIB}
+WANTLIB-userdb=		c courierauthcommon courierauth gdbm>=3 \
+			${MODGETTEXT_WANTLIB} pthread
 LIB_DEPENDS-userdb=	${BUILD_PKGPATH} \
 			${MODGETTEXT_LIB_DEPENDS} \
 			databases/gdbm
Index: patches/patch-authldap_h
===================================================================
RCS file: patches/patch-authldap_h
diff -N patches/patch-authldap_h
--- patches/patch-authldap_h	18 Oct 2012 08:04:01 -0000	1.4
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,12 +0,0 @@
-$OpenBSD: patch-authldap_h,v 1.4 2012/10/18 08:04:01 giovanni Exp $
---- authldap.h.orig	Wed May 25 04:44:12 2011
-+++ authldap.h	Fri Sep  7 14:34:02 2012
-@@ -7,6 +7,8 @@
- ** distribution information.
- */
- 
-+#define LDAP_DEPRECATED 1
-+
- /* Based on code by Luc Saillard <luc.saill...@alcove.fr>. */
- 
- #if	HAVE_CONFIG_H
Index: patches/patch-authldaplib_c
===================================================================
RCS file: patches/patch-authldaplib_c
diff -N patches/patch-authldaplib_c
--- patches/patch-authldaplib_c	25 Jun 2007 12:12:26 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,19 +0,0 @@
-$OpenBSD: patch-authldaplib_c,v 1.1 2007/06/25 12:12:26 espie Exp $
---- authldaplib.c.orig	Mon Jun 25 12:54:11 2007
-+++ authldaplib.c	Mon Jun 25 12:56:10 2007
-@@ -92,6 +92,7 @@ authldap_free_config removed - no longer required.
- #if HAVE_UNISTD_H
- #include <unistd.h>
- #endif
-+#include "authldap.h"
- #if HAVE_LBER_H
- #include <lber.h>
- #endif
-@@ -108,7 +109,6 @@ authldap_free_config removed - no longer required.
- #include <sys/stat.h>
- #endif
- 
--#include "authldap.h"
- #include "auth.h"
- #include "authldaprc.h"
- #include "courierauthdebug.h"
Index: pkg/PLIST-main
===================================================================
RCS file: /var/cvs/ports/mail/courier-authlib/pkg/PLIST-main,v
retrieving revision 1.7
diff -u -p -r1.7 PLIST-main
--- pkg/PLIST-main	25 Jan 2014 13:12:12 -0000	1.7
+++ pkg/PLIST-main	27 Oct 2014 17:51:59 -0000
@@ -41,7 +41,6 @@ libexec/courier-authlib/sysconftool
 @man man/man3/auth_login.3
 @man man/man3/auth_passwd.3
 @man man/man3/auth_sasl.3
-@man man/man3/auth_sasl_ex.3
 @man man/man3/authlib.3
 sbin/authdaemond
 @bin sbin/authenumerate

Reply via email to