aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2017-10-30 13:53:38 +0800
committerdelphij <delphij@FreeBSD.org>2017-10-30 13:53:38 +0800
commitd85858b611c5cd8256efd54753b1ce3a43736878 (patch)
tree3cfdde768dd6e8f5323624803e6bc585e0d83a0d /net
parent50d3e534c2b3b5d90a715ff5f1daaf19ab001345 (diff)
downloadfreebsd-ports-gnome-d85858b611c5cd8256efd54753b1ce3a43736878.tar.gz
freebsd-ports-gnome-d85858b611c5cd8256efd54753b1ce3a43736878.tar.zst
freebsd-ports-gnome-d85858b611c5cd8256efd54753b1ce3a43736878.zip
Workaround an issue with kqueue support.
OpenLDAP does slapd_daemon_init() which will initialize kqueue(), but then calls lutil_detach() which will fork(), and the fork() would invalidate the kqueue descriptor in the child process. Completely solving this would require some intrusive changes so workaround this for now by calling rfork() without RFFDG and reorder file descriptor closure order. While I'm there also refrain from stopping slapd when deinstalling.
Diffstat (limited to 'net')
-rw-r--r--net/openldap24-server/Makefile2
-rw-r--r--net/openldap24-server/files/extrapatch-ITS630028
-rw-r--r--net/openldap24-server/pkg-plist1
3 files changed, 29 insertions, 2 deletions
diff --git a/net/openldap24-server/Makefile b/net/openldap24-server/Makefile
index c6380b37196e..fbe735a7a1c7 100644
--- a/net/openldap24-server/Makefile
+++ b/net/openldap24-server/Makefile
@@ -65,7 +65,7 @@ BROKEN= incompatible OpenLDAP version: ${WANT_OPENLDAP_VER}
.endif
PORTREVISION_CLIENT= 0
-PORTREVISION_SERVER= 2
+PORTREVISION_SERVER= 3
OPENLDAP_SHLIB_MAJOR= 2
OPENLDAP_SHLIB_MINOR= 10.8
OPENLDAP_MAJOR= ${DISTVERSION:R}
diff --git a/net/openldap24-server/files/extrapatch-ITS6300 b/net/openldap24-server/files/extrapatch-ITS6300
index 35bffa449307..e59960d9aa3b 100644
--- a/net/openldap24-server/files/extrapatch-ITS6300
+++ b/net/openldap24-server/files/extrapatch-ITS6300
@@ -404,3 +404,31 @@
if ( LogTest( LDAP_DEBUG_ANY )) {
int t = ldap_pvt_thread_pool_backload( &connection_pool );
+--- libraries/liblutil/detach.c.orig 2017-06-01 20:01:07 UTC
++++ libraries/liblutil/detach.c
+@@ -73,7 +73,7 @@ lutil_detach( int debug, int do_close )
+ #ifdef HAVE_THR
+ pid = fork1();
+ #else
+- pid = fork();
++ pid = rfork(RFPROC);
+ #endif
+ switch ( pid )
+ {
+--- servers/slapd/main.c.orig 2017-06-01 20:01:07 UTC
++++ servers/slapd/main.c
+@@ -923,12 +923,11 @@ unhandled_option:;
+ if ( pid ) {
+ char buf[4];
+ rc = EXIT_SUCCESS;
+- close( waitfds[1] );
+ if ( read( waitfds[0], buf, 1 ) != 1 )
+ rc = EXIT_FAILURE;
+- _exit( rc );
+- } else {
++ close( waitfds[1] );
+ close( waitfds[0] );
++ _exit( rc );
+ }
+ }
+ #endif /* HAVE_WINSOCK */
diff --git a/net/openldap24-server/pkg-plist b/net/openldap24-server/pkg-plist
index 4c3ec2090802..9fbbc2ef7ec8 100644
--- a/net/openldap24-server/pkg-plist
+++ b/net/openldap24-server/pkg-plist
@@ -1,4 +1,3 @@
-@preunexec %%RC_DIR%%/etc/rc.d/slapd stop 2>&1 >/dev/null || true
%%ETCDIR%%/schema/README
%%ETCDIR%%/schema/collective.ldif
@sample %%ETCDIR%%/schema/collective.schema.sample