IPA installation failed when mozldap-devel package was not installed.
This patch solves this:

Mozldap code removed from all sources and configure source script.
Now, IPA will compile even when package mozldap-devel is not
installed on the system.

https://fedorahosted.org/freeipa/ticket/756

>From 11604377cb03225f723fdd99da257e217260a9a5 Mon Sep 17 00:00:00 2001
From: Martin Kosek <[email protected]>
Date: Fri, 14 Jan 2011 13:41:05 +0100
Subject: [PATCH] Mozldap-specific code removed

Mozldap code removed from all sources and configure source script.
Now, IPA will compile even when package mozldap-devel is not
installed on the system.

https://fedorahosted.org/freeipa/ticket/756
---
 daemons/configure.ac                               |   13 +++-------
 daemons/ipa-kpasswd/ipa_kpasswd.c                  |   10 --------
 .../ipa-pwd-extop/ipapwd_common.c                  |   16 -------------
 .../ipa-slapi-plugins/ipa-winsync/ipa-winsync.c    |   24 +++----------------
 ipa-client/Makefile.am                             |    2 -
 ipa-client/ipa-getkeytab.c                         |    4 ---
 6 files changed, 8 insertions(+), 61 deletions(-)

diff --git a/daemons/configure.ac b/daemons/configure.ac
index 72ff750ec4aa71e479f9cd2a4ea0ca76ae54ec7f..c024c12cfe7446667145067a0a5416d96a874247 100644
--- a/daemons/configure.ac
+++ b/daemons/configure.ac
@@ -189,15 +189,10 @@ AC_ARG_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}"
-    AC_DEFINE_UNQUOTED(WITH_OPENLDAP, 1, [Use OpenLDAP libraries])
-else
-    LDAP_CFLAGS="${MOZLDAP_CFLAGS}"
-    LDAP_LIBS="${MOZLDAP_LIBS}"
-    AC_DEFINE_UNQUOTED(WITH_MOZLDAP, 1, [Use Mozilla LDAP libraries])
-fi
+LDAP_CFLAGS="${OPENLDAP_CFLAGS} $NSPR4 $NSS3 -DUSE_OPENLDAP"
+LDAP_LIBS="${OPENLDAP_LIBS}"
+AC_DEFINE_UNQUOTED(WITH_OPENLDAP, 1, [Use OpenLDAP libraries])
+
 AC_SUBST(LDAP_CFLAGS)
 AC_SUBST(LDAP_LIBS)
 
diff --git a/daemons/ipa-kpasswd/ipa_kpasswd.c b/daemons/ipa-kpasswd/ipa_kpasswd.c
index a506cec1d0c89a749fc14a91bfb6936e3533694a..0c00e13d1820f99167a92281bbc27bb8a40e646b 100644
--- a/daemons/ipa-kpasswd/ipa_kpasswd.c
+++ b/daemons/ipa-kpasswd/ipa_kpasswd.c
@@ -39,11 +39,7 @@
 #include <arpa/inet.h>
 #include <time.h>
 #include <krb5.h>
-#ifdef WITH_MOZLDAP
-#include <mozldap/ldap.h>
-#else
 #include <ldap.h>
-#endif
 #include <sasl/sasl.h>
 #include <ifaddrs.h>
 
@@ -51,12 +47,6 @@
 #define TMP_TEMPLATE "/var/cache/ipa/kpasswd/krb5_cc.XXXXXX"
 #define KPASSWD_PORT 464
 
-#ifdef WITH_MOZLDAP
-/* From OpenLDAP's ldap.h */
-#define LDAP_TAG_EXOP_MODIFY_PASSWD_ID  ((ber_tag_t) 0x80U)
-#define LDAP_TAG_EXOP_MODIFY_PASSWD_NEW ((ber_tag_t) 0x82U)
-#endif
-
 /* blacklist entries are released only BLCAKLIST_TIMEOUT seconds
  * after the children performing the noperation has finished.
  * this is to avoid races */
diff --git a/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd_common.c b/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd_common.c
index 2bc36c09e40c174e1a90ed3e6b2162cb8353cddb..a267fa9e5317324aeb1208fa1b378c6297494645 100644
--- a/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd_common.c
+++ b/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd_common.c
@@ -376,21 +376,6 @@ static void pwd_values_free(Slapi_ValueSet** results,
 static int ipapwd_rdn_count(const char *dn)
 {
     int rdnc = 0;
-
-#ifdef WITH_MOZLDAP
-    char **edn;
-
-    edn = ldap_explode_dn(dn, 0);
-    if (!edn) {
-        LOG_TRACE("ldap_explode_dn(dn) failed ?!");
-        return -1;
-    }
-
-    for (rdnc = 0; edn != NULL && edn[rdnc]; rdnc++) /* count */ ;
-    ldap_value_free(edn);
-#else
-    /* both ldap_explode_dn and ldap_value_free are deprecated
-     * in OpenLDAP */
     LDAPDN ldn;
     int ret;
 
@@ -402,7 +387,6 @@ static int ipapwd_rdn_count(const char *dn)
 
     for (rdnc = 0; ldn != NULL && ldn[rdnc]; rdnc++) /* count */ ;
     ldap_dnfree(ldn);
-#endif
 
     return rdnc;
 }
diff --git a/daemons/ipa-slapi-plugins/ipa-winsync/ipa-winsync.c b/daemons/ipa-slapi-plugins/ipa-winsync/ipa-winsync.c
index bfad0cf2b515430a2c5ea55756cfba9931588613..3816ff567ad293783f02a3e66cddafcf348307c0 100644
--- a/daemons/ipa-slapi-plugins/ipa-winsync/ipa-winsync.c
+++ b/daemons/ipa-slapi-plugins/ipa-winsync/ipa-winsync.c
@@ -376,6 +376,10 @@ ipa_winsync_get_new_ds_user_dn_cb(void *cbdata, const Slapi_Entry *rawentry,
     PRBool flatten = PR_TRUE;
     IPA_WinSync_Config *ipaconfig = ipa_winsync_get_config();
 
+    LDAPDN ldn;
+    int ret;
+    char *rdn;
+
     LOG("--> ipa_winsync_get_new_ds_user_dn_cb -- old dn [%s] -- begin\n",
                     *new_dn_string);
 
@@ -387,25 +391,6 @@ ipa_winsync_get_new_ds_user_dn_cb(void *cbdata, const Slapi_Entry *rawentry,
         return;
     }
 
-#ifdef WITH_MOZLDAP
-    char **rdns = NULL;
-
-    rdns = ldap_explode_dn(*new_dn_string, 0);
-    if (!rdns || !rdns[0]) {
-        ldap_value_free(rdns);
-        return;
-    }
-
-    slapi_ch_free_string(new_dn_string);
-    *new_dn_string = slapi_ch_smprintf("%s,%s", rdns[0], slapi_sdn_get_dn(ds_suffix));
-    ldap_value_free(rdns);
-#else
-    /* both ldap_explode_dn and ldap_value_free are deprecated
-     * in OpenLDAP */
-    LDAPDN ldn;
-    int ret;
-    char *rdn;
-
     ret = ldap_str2dn(*new_dn_string, &ldn, LDAP_DN_FORMAT_LDAPV3);
     if (ret != LDAP_SUCCESS) {
         LOG_TRACE("ldap_str2dn(dn) failed ?!");
@@ -416,7 +401,6 @@ ipa_winsync_get_new_ds_user_dn_cb(void *cbdata, const Slapi_Entry *rawentry,
     *new_dn_string = slapi_ch_smprintf("%s,%s", rdn, slapi_sdn_get_dn(ds_suffix));
     ldap_dnfree(ldn);
     ldap_memfree(rdn);
-#endif
 
     LOG("<-- ipa_winsync_get_new_ds_user_dn_cb -- new dn [%s] -- end\n",
                     *new_dn_string);
diff --git a/ipa-client/Makefile.am b/ipa-client/Makefile.am
index 7d152fbfd38391a6ab6feb2f549086f19acf8d2a..d0a3f8463a53411286f52dcc552186b9a36b7b88 100644
--- a/ipa-client/Makefile.am
+++ b/ipa-client/Makefile.am
@@ -28,7 +28,6 @@ INCLUDES =							\
 	$(AM_CFLAGS)						\
 	$(KRB5_CFLAGS)						\
 	$(OPENLDAP_CFLAGS)					\
-	$(MOZLDAP_CFLAGS)					\
 	$(SASL_CFLAGS)						\
 	$(POPT_CFLAGS)						\
 	$(WARN_CFLAGS)						\
@@ -49,7 +48,6 @@ ipa_getkeytab_SOURCES =		\
 ipa_getkeytab_LDADD = 		\
 	$(KRB5_LIBS)		\
 	$(OPENLDAP_LIBS)	\
-	$(MOZLDAP_LIBS)		\
 	$(SASL_LIBS)		\
 	$(POPT_LIBS)		\
 	$(NULL)
diff --git a/ipa-client/ipa-getkeytab.c b/ipa-client/ipa-getkeytab.c
index e4c7b0e2b114b0970e805921e10eaefca4d6d6f2..ab463b0c8c34e2b5fff9e023127a018cb7ad9757 100644
--- a/ipa-client/ipa-getkeytab.c
+++ b/ipa-client/ipa-getkeytab.c
@@ -32,11 +32,7 @@
 #include <errno.h>
 #include <time.h>
 #include <krb5.h>
-#ifdef WITH_MOZLDAP
-#include <mozldap/ldap.h>
-#else
 #include <ldap.h>
-#endif
 #include <sasl/sasl.h>
 #include <popt.h>
 
-- 
1.7.3.4

_______________________________________________
Freeipa-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to