Re: [Freeipa-devel] [PATCH] 0023 Compiles plugin against the right ldap libraries

2010-12-06 Thread Rob Crittenden

Jan Zelený wrote:

Simo Sorcesso...@redhat.com  wrote:

On Fri, 03 Dec 2010 17:25:20 -0700

Rich Megginsonrmegg...@redhat.com  wrote:

On 12/03/2010 04:26 PM, Simo Sorce wrote:

In Fedora 14, 389-ds started linking against openldap libraries
instead of the old mozldap libraries.

This patch allows us to conditionally build plugins against
openldap as well. Failure to do so may cause symbol clashes when
the plugin is used by directory server because then we get 2
different ldap libraries loaded at the same time.

The spec file has already been changed to build plugins
--with-openldap by default.


ack but only if the goal is to remove use of #define LDAP_DEPRECATED
1 - I can help with this


The only reason I kept that is that we use ldap_explode_dn(), that
function is not itself deprecated (ie it is not under LDAP_DEPRECATED
ifdefs although a comment syas it is deprecated), but it returns char
**, and the only function that frees a char ** is ldap_free_value().
This one is under LDAP_DEPRECATED and says you shoud use
ldap_free_value_len(), but that functions takes a struct berval as
argument.

I think there are only 2 places/plugins where those deprecated
functions are used. So if you want to open a ticket to remove them feel
free, but I would do that as a separate patch.
The goal of this patch was to do as few modifications as possible to
the plugins themselves.


I can confirm this patch solves some installation issues on F14, so if Rob
agrees, I'd like to ack this.


Works for me too, ack.

rob

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCH] 0023 Compiles plugin against the right ldap libraries

2010-12-06 Thread Simo Sorce
On Mon, 06 Dec 2010 11:22:38 -0500
Rob Crittenden rcrit...@redhat.com wrote:

 Jan Zelený wrote:
  Simo Sorcesso...@redhat.com  wrote:
  On Fri, 03 Dec 2010 17:25:20 -0700
 
  Rich Megginsonrmegg...@redhat.com  wrote:
  On 12/03/2010 04:26 PM, Simo Sorce wrote:
  In Fedora 14, 389-ds started linking against openldap libraries
  instead of the old mozldap libraries.
 
  This patch allows us to conditionally build plugins against
  openldap as well. Failure to do so may cause symbol clashes when
  the plugin is used by directory server because then we get 2
  different ldap libraries loaded at the same time.
 
  The spec file has already been changed to build plugins
  --with-openldap by default.
 
  ack but only if the goal is to remove use of #define
  LDAP_DEPRECATED 1 - I can help with this
 
  The only reason I kept that is that we use ldap_explode_dn(), that
  function is not itself deprecated (ie it is not under
  LDAP_DEPRECATED ifdefs although a comment syas it is deprecated),
  but it returns char **, and the only function that frees a char **
  is ldap_free_value(). This one is under LDAP_DEPRECATED and says
  you shoud use ldap_free_value_len(), but that functions takes a
  struct berval as argument.
 
  I think there are only 2 places/plugins where those deprecated
  functions are used. So if you want to open a ticket to remove them
  feel free, but I would do that as a separate patch.
  The goal of this patch was to do as few modifications as possible
  to the plugins themselves.
 
  I can confirm this patch solves some installation issues on F14, so
  if Rob agrees, I'd like to ack this.
 
 Works for me too, ack.

Pushed to master

Simo.

-- 
Simo Sorce * Red Hat, Inc * New York

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

[Freeipa-devel] [PATCH] 0023 Compiles plugin against the right ldap libraries

2010-12-03 Thread Simo Sorce

In Fedora 14, 389-ds started linking against openldap libraries instead
of the old mozldap libraries.

This patch allows us to conditionally build plugins against openldap as
well. Failure to do so may cause symbol clashes when the plugin is used
by directory server because then we get 2 different ldap libraries
loaded at the same time.

The spec file has already been changed to build plugins --with-openldap
by default.

Simo.

-- 
Simo Sorce * Red Hat, Inc * New York
From 4bdfe38e0ce4f2aaeb07ac43880ca87cd30f9d57 Mon Sep 17 00:00:00 2001
From: Simo Sorce sso...@redhat.com
Date: Fri, 3 Dec 2010 15:02:29 -0500
Subject: [PATCH] Make use of mozldap vs openldap for plugins selectable

---
 daemons/configure.ac   |   21 ---
 .../ipa-slapi-plugins/ipa-enrollment/Makefile.am   |4 +-
 daemons/ipa-slapi-plugins/ipa-modrdn/Makefile.am   |4 +-
 .../ipa-slapi-plugins/ipa-pwd-extop/Makefile.am|4 +-
 daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd.h   |2 +
 .../ipa-pwd-extop/ipapwd_common.c  |4 +-
 daemons/ipa-slapi-plugins/ipa-uuid/Makefile.am |4 +-
 daemons/ipa-slapi-plugins/ipa-version/Makefile.am  |4 +-
 daemons/ipa-slapi-plugins/ipa-winsync/Makefile.am  |4 +-
 .../ipa-slapi-plugins/ipa-winsync/ipa-winsync.c|3 ++
 ipa.spec.in|4 +++
 11 files changed, 40 insertions(+), 18 deletions(-)

diff --git a/daemons/configure.ac b/daemons/configure.ac
index d959f987a49f4cefb1c96fd86d89ce1b4749f7aa..221a63a7f4dca8352b41874c777469cadc685d7a 100644
--- a/daemons/configure.ac
+++ b/daemons/configure.ac
@@ -137,11 +137,9 @@ fi
 AC_SUBST(KRB5_LIBS)
 
 dnl ---
-dnl - Check for Mozilla LDAP *and* OpenLDAP SDK
+dnl - Check for Mozilla LDAP and OpenLDAP SDK
 dnl ---
 
-dnl The mozldap libraries are always needed because ipa-slapi-plugins/dna/ 
-dnl will not build against OpenLDAP.
 SAVE_CPPFLAGS=$CPPFLAGS
 CPPFLAGS=$NSPR4 $NSS3
 AC_CHECK_HEADER(svrcore.h)
@@ -193,6 +191,21 @@ AC_SUBST(OPENLDAP_LIBS)
 OPENLDAP_CFLAGS=${OPENLDAP_CFLAGS} -DWITH_OPENLDAP
 AC_SUBST(OPENLDAP_CFLAGS)
 
+AC_ARG_WITH([openldap],
+[AS_HELP_STRING([--with-openldap],
+[compile plugins with openldap instead of mozldap])],
+[], [])
+
+if test x$with_openldap == xyes; then
+LDAP_CFLAGS=${OPENLDAP_CFLAGS} $NSPR4 $NSS3 -DUSE_OPENLDAP
+LDAP_LIBS=${OPENLDAP_LIBS}
+else
+LDAP_CFLAGS=${MOZLDAP_CFLAGS}
+LDAP_LIBS=${MOZLDAP_LIBS}
+fi
+AC_SUBST(LDAP_CFLAGS)
+AC_SUBST(LDAP_LIBS)
+
 dnl ---
 dnl - Check for OpenSSL Crypto library
 dnl ---
@@ -312,7 +325,7 @@ echo 
 	source code location:	  ${srcdir}
 	compiler:		  ${CC}
 	cflags:		  ${CFLAGS}
-LDAP libs:${OPENLDAP_LIBS}
+LDAP libs:${LDAP_LIBS}
 KRB5 libs:${KRB5_LIBS}
 OpenSSL libs: ${SSL_LIBS}
 Maintainer mode:  ${USE_MAINTAINER_MODE}
diff --git a/daemons/ipa-slapi-plugins/ipa-enrollment/Makefile.am b/daemons/ipa-slapi-plugins/ipa-enrollment/Makefile.am
index d041815a2693a990431e2f42d22d0ae6ad5024fa..c3bb279598cc6eafbaa545ef0774882d2fe98a1e 100644
--- a/daemons/ipa-slapi-plugins/ipa-enrollment/Makefile.am
+++ b/daemons/ipa-slapi-plugins/ipa-enrollment/Makefile.am
@@ -12,7 +12,7 @@ INCLUDES =			\
 	-DLIBEXECDIR=\$(libexecdir)\			\
 	-DDATADIR=\$(datadir)\\
 	$(AM_CFLAGS)		\
-	$(MOZLDAP_CFLAGS)	\
+	$(LDAP_CFLAGS)	\
 	$(KRB5_CFLAGS)		\
 	$(WARN_CFLAGS)		\
 	$(NULL)
@@ -29,7 +29,7 @@ libipa_enrollment_extop_la_SOURCES = 	\
 libipa_enrollment_extop_la_LDFLAGS = -avoid-version
 
 libipa_enrollment_extop_la_LIBADD = 	\
-	$(MOZLDAP_LIBS)			\
+	$(LDAP_LIBS)			\
 	$(NULL)
 
 appdir = $(IPA_DATA_DIR)
diff --git a/daemons/ipa-slapi-plugins/ipa-modrdn/Makefile.am b/daemons/ipa-slapi-plugins/ipa-modrdn/Makefile.am
index b7986874822690422f015b1d39454c2ed9995340..5d9db51f41c427894961d8af2b9b6b8d4d289ae0 100644
--- a/daemons/ipa-slapi-plugins/ipa-modrdn/Makefile.am
+++ b/daemons/ipa-slapi-plugins/ipa-modrdn/Makefile.am
@@ -13,7 +13,7 @@ INCLUDES =			\
 	-DLIBEXECDIR=\$(libexecdir)\			\
 	-DDATADIR=\$(datadir)\\
 	$(AM_CFLAGS)		\
-	$(MOZLDAP_CFLAGS)	\
+	$(LDAP_CFLAGS)	\
 	$(WARN_CFLAGS)		\
 	$(NULL)
 
@@ -29,7 +29,7 @@ libipa_modrdn_la_SOURCES = 	\
 libipa_modrdn_la_LDFLAGS = -avoid-version
 
 libipa_modrdn_la_LIBADD = 	\
-	$(MOZLDAP_LIBS)		\
+	$(LDAP_LIBS)		\
 	$(NULL)
 
 appdir = $(IPA_DATA_DIR)
diff --git a/daemons/ipa-slapi-plugins/ipa-pwd-extop/Makefile.am b/daemons/ipa-slapi-plugins/ipa-pwd-extop/Makefile.am
index