[SSSD] [PATCH] Making the ldb check configurable

Lukas Slebodnik lslebodn at redhat.com
Wed Mar 13 10:23:07 UTC 2013


Hi,

attached patch should fix ticket
https://fedorahosted.org/sssd/ticket/1813

Comments welcomed.

LS
-------------- next part --------------
>From a2dca2e1a5be39ce9208ccc44ed10092f4080ea9 Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lslebodn at redhat.com>
Date: Wed, 13 Mar 2013 11:09:11 +0100
Subject: [PATCH] Making the ldb check configurable

It is possible to enable/disable checking in LDB memberof plugin
whether it was built against the same version of LDB that is present
on the system. This feature is turned off by default
and enabled in Fedora/RHEL spec file.
---
 contrib/sssd.spec.in       |  1 +
 src/external/libldb.m4     | 15 +++++++++++++++
 src/ldb_modules/memberof.c |  4 ++--
 3 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/contrib/sssd.spec.in b/contrib/sssd.spec.in
index 7f124f5cd9dc602481cb5f4ae7a5a9418b6c8bf9..7c1f7048a70729090c5b27e1c7b9434f0e04d99a 100644
--- a/contrib/sssd.spec.in
+++ b/contrib/sssd.spec.in
@@ -262,6 +262,7 @@ autoreconf -ivf
     --with-krb5-rcache-dir=%{_localstatedir}/cache/krb5rcache \
     --enable-nsslibdir=/%{_lib} \
     --enable-pammoddir=/%{_lib}/security \
+    --enable-ldb-version-check \
     --disable-static \
     --disable-rpath \
     %{?with_ccache} \
diff --git a/src/external/libldb.m4 b/src/external/libldb.m4
index d3d3ccecec303d17102cedccfaba0db70329002d..2e89cec8085f1e44731874cbed47206f78314cb7 100644
--- a/src/external/libldb.m4
+++ b/src/external/libldb.m4
@@ -24,5 +24,20 @@ else
         ldblibdir="${libdir}/ldb"
     fi
 fi
+
+AC_MSG_CHECKING([feature ldb runtime version check])
+AC_ARG_ENABLE(ldb-version-check,
+              [AS_HELP_STRING([--enable-ldb-version-check],
+                              [compile without ldb runtime version check])],
+              enable_ldb_version_check="$enableval",
+              enable_ldb_version_check="no")
+if test x"$enable_ldb_version_check" = xyes ; then
+    AC_MSG_RESULT([yes])
+    AC_DEFINE([LDB_VERSION_CHECK], [1],
+              [Define to 1 if you want ldb version check.])
+else
+    AC_MSG_RESULT([no])
+fi
+
 AC_MSG_NOTICE([ldb lib directory: $ldblibdir])
 AC_SUBST(ldblibdir)
diff --git a/src/ldb_modules/memberof.c b/src/ldb_modules/memberof.c
index f7eeb4070748d4a4f517c44520f9a501dd48a245..0247bc9df2dd49bd1eb9a6100d126d50d00da0ec 100644
--- a/src/ldb_modules/memberof.c
+++ b/src/ldb_modules/memberof.c
@@ -4566,8 +4566,8 @@ const struct ldb_module_ops ldb_memberof_module_ops = {
 
 int ldb_init_module(const char *version)
 {
-#ifdef LDB_MODULE_CHECK_VERSION
+#ifdef LDB_VERSION_CHECK
     LDB_MODULE_CHECK_VERSION(version);
-#endif
+#endif /* LDB_VERSION_CHECK */
     return ldb_register_module(&ldb_memberof_module_ops);
 }
-- 
1.8.1.4



More information about the sssd-devel mailing list