components/samba/samba/patches/mozldap.patch
branchs11-sru
changeset 2243 4307245757f6
child 1396 2c75b46fc80a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/samba/samba/patches/mozldap.patch	Mon Jan 30 18:04:00 2012 -0800
@@ -0,0 +1,57 @@
+--- a/source3/configure.in	2011-12-12 10:59:00.851079500 -0800
++++ b/source3/configure.in	2011-12-12 11:29:54.993566333 -0800
+@@ -3368,6 +3368,20 @@
+     with_ldap_support=yes
+     AC_MSG_CHECKING(whether LDAP support is used)
+     AC_MSG_RESULT(yes)
++
++    ##############################
++    # Check if LDAP SDK is Mozilla
++    AC_CACHE_CHECK([for LDAP_OPT_SIZELIMIT macro],samba_cv_HAVE_LDAP_MOZ,[
++    AC_TRY_COMPILE([
++#include <stdio.h>
++#include <ldap.h>],
++    [printf("%s\n", LDAP_OPT_SIZELIMIT);],
++    samba_cv_HAVE_LDAP_MOZ=yes,samba_cv_HAVE_LDAP_MOZ=no)])
++    if test x"$samba_cv_HAVE_LDAP_MOZ" = x"yes"; then
++	AC_DEFINE(HAVE_HAVE_LDAP_MOZ,1,
++		[Whether the LDAP SDK is Mozilla])
++    fi
++
+   else
+     if test x"$with_ldap_support" = x"yes"; then
+ 	AC_MSG_ERROR(libldap is needed for LDAP support)
+@@ -3415,8 +3429,21 @@
+     # Check to see whether there is enough LDAP functionality to be able
+     # to build AD support.
+ 
+-# HPUX only has ldap_init; ok, we take care of this in smbldap.c
+-case "$host_os" in
++ if test x"$samba_cv_HAVE_LDAP_MOZ" = x"yes"; then
++  # Mozilla LDAP C-SDK has only has ldap_open/ldap_init; ok, we take care of this in smbldap.c
++  AC_CHECK_FUNC_EXT(ldap_open,$LDAP_LIBS)
++
++  if test x"$ac_cv_func_ext_ldap_open" != x"yes"; then
++    if test x"$with_ads_support" = x"yes"; then
++      AC_MSG_ERROR(Active Directory support with Mozldap C-SDK requires ldap_open)
++    elif test x"$with_ads_support" = x"auto"; then
++      AC_MSG_WARN(Disabling Active Directory support (requires ldap_open with Mozldap C-SDK))
++      with_ads_support=no
++    fi
++  fi
++ else
++  # HPUX only has ldap_init; ok, we take care of this in smbldap.c
++  case "$host_os" in
+ 	*hpux*)
+     AC_CHECK_FUNC_EXT(ldap_init,$LDAP_LIBS)
+ 
+@@ -3441,7 +3468,8 @@
+ 	fi
+     fi
+     ;;
+-esac
++  esac
++ fi
+ 
+ 
+     AC_CHECK_FUNC_EXT(ldap_add_result_entry,$LDAP_LIBS)