OpenLDAP nearly has support for the DCE 1.1 RPC UUID functions that we

have in libc but not quite - it looks for a uuid_to_str with same api
as uuid_to_string(3) (unsure where this would come from, searches don't
reveal any other software using it).

Patch to allow it to use the libc functions instead of Linux libuuid
(which in our case comes from the e2fstools package).
This commit is contained in:
sthen 2020-06-18 21:36:10 +00:00
parent 9c22bbc80f
commit f1877139c6
3 changed files with 60 additions and 4 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.175 2020/06/18 20:38:41 sthen Exp $
# $OpenBSD: Makefile,v 1.176 2020/06/18 21:36:10 sthen Exp $
DPB_PROPERTIES = parallel
@ -8,7 +8,7 @@ COMMENT-server = open-source LDAP software (server)
DISTNAME = openldap-2.4.50
PKGNAME-main = ${DISTNAME:S/-/-client-/}
PKGNAME-server = ${DISTNAME:S/-/-server-/}
REVISION = 2
REVISION = 3
# overwrite -main pkgname/path to strip FLAVOR, aci only affects the server
FULLPKGNAME-main = ${DISTNAME:S/-/-client-/}${FLAVOR_EXT:S/-aci//}
@ -104,14 +104,13 @@ WANTLIB += pthread sasl2
CPPFLAGS += -I${LOCALBASE}/include/sasl
LIB_DEPENDS-server = ${LIB_DEPENDS-main} \
sysutils/e2fsprogs \
databases/db/v4,no_java,no_tcl \
databases/openldap,-main
CONFIGURE_ENV += CPPFLAGS="-I${LOCALBASE}/include/sasl -I${LOCALBASE}/include/db4 -I${LOCALBASE}/include" \
LDFLAGS="-L${LOCALBASE}/lib/db4 -L${LOCALBASE}/lib"
WANTLIB-server += ${WANTLIB} lber ldap_r lib/db4/db>=4 m perl uuid
WANTLIB-server += ${WANTLIB} lber ldap_r lib/db4/db>=4 m perl
FAKE_FLAGS = sysconfdir=${PREFIX}/share/examples/openldap

View File

@ -0,0 +1,27 @@
$OpenBSD: patch-configure_in,v 1.7 2020/06/18 21:36:11 sthen Exp $
OpenLDAP's first choice uuid functions are close to but not quite the same
as we have in libc, differences being that we don't have uuid_to_str() (in
fact I don't see which other OS might have it either, no other software in
debian codesearch uses this), and it needs uuid.h not sys/uuid.h.
Patch to use it, avoiding the need for Linux libuuid.
Index: configure.in
--- configure.in.orig
+++ configure.in
@@ -1018,11 +1018,11 @@ dnl --------------------------------------------------
dnl UUID Support
have_uuid=no
-AC_CHECK_HEADERS(sys/uuid.h)
+AC_CHECK_HEADERS(uuid.h)
dnl The HAVE_UUID_TO_STR code path also needs uuid_create
-if test $ac_cv_header_sys_uuid_h = yes ; then
+if test $ac_cv_header_uuid_h = yes ; then
save_LIBS="$LIBS"
- AC_SEARCH_LIBS([uuid_to_str], [uuid], [have_uuid=yes], :)
+ AC_SEARCH_LIBS([uuid_to_string], [uuid], [have_uuid=yes], :)
AC_SEARCH_LIBS([uuid_create], [uuid], :, [have_uuid=no])
LIBS="$save_LIBS"

View File

@ -0,0 +1,30 @@
$OpenBSD: patch-libraries_liblutil_uuid_c,v 1.1 2020/06/18 21:36:11 sthen Exp $
OpenLDAP's first choice uuid functions are close to but not quite the same
as we have in libc, differences being that we don't have uuid_to_str() (in
fact I don't see which other OS might have it either, no other software in
debian codesearch uses this), and it needs uuid.h not sys/uuid.h.
Patch to use it, avoiding the need for Linux libuuid.
Index: libraries/liblutil/uuid.c
--- libraries/liblutil/uuid.c.orig
+++ libraries/liblutil/uuid.c
@@ -40,7 +40,7 @@
#include <ac/string.h> /* get memcmp() */
#ifdef HAVE_UUID_TO_STR
-# include <sys/uuid.h>
+# include <uuid.h>
#elif defined( HAVE_UUID_GENERATE )
# include <uuid/uuid.h>
#elif defined( _WIN32 )
@@ -284,7 +284,7 @@ lutil_uuidstr( char *buf, size_t len )
return 0;
}
- uuid_to_str( &uu, &s, &rc );
+ uuid_to_string( &uu, &s, &rc );
if ( rc != uuid_s_ok ) {
return 0;
}