s3-build: stop including ldap and lber headers everywhere in the code.
authorGünther Deschner <gd@samba.org>
Thu, 24 Feb 2011 10:56:08 +0000 (11:56 +0100)
committerGünther Deschner <gd@samba.org>
Wed, 16 Mar 2011 09:54:50 +0000 (10:54 +0100)
Instead use new header smb_ldap.h where all LDAP API related things are handled,
while smbldap.h only deals with our smbldap_X() API.

Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Wed Mar 16 10:54:51 CET 2011 on sn-devel-104

source3/include/ads.h
source3/include/includes.h
source3/include/smb_ldap.h [new file with mode: 0644]
source3/include/smbldap.h
source3/lib/ldap_debug_handler.c
source3/libads/ads_status.c
source3/libsmb/nterr.c
source3/winbindd/winbindd.h

index 6ef5455766c88f804b8d2b27e80fd243c6d8cb91..ee6e5b8649b6366d23fe0c6e5576065de7d6466b 100644 (file)
@@ -6,6 +6,8 @@
   basically this is a wrapper around ldap
 */
 
+#include "smb_ldap.h"
+
 struct ads_struct;
 
 struct ads_saslwrap_ops {
index 41483525fa315809dc5c57ec8fe1e2eaf3e482a6..eafecb7fdad0faa205a2e8a43fb6e528f83f0751 100644 (file)
 #undef HAVE_KRB5
 #endif
 
-#if HAVE_LBER_H
-#include <lber.h>
-#if defined(HPUX) && !defined(_LBER_TYPES_H)
-/* Define ber_tag_t and ber_int_t for using
- * HP LDAP-UX Integration products' LDAP libraries.
-*/
-#ifndef ber_tag_t
-typedef unsigned long ber_tag_t;
-typedef int ber_int_t;
-#endif
-#endif /* defined(HPUX) && !defined(_LBER_TYPES_H) */
-#ifndef LBER_USE_DER
-#define LBER_USE_DER 0x01
-#endif
-#endif
-
-#if HAVE_LDAP_H
-#include <ldap.h>
-#ifndef LDAP_CONST
-#define LDAP_CONST const
-#endif
-#ifndef LDAP_OPT_SUCCESS
-#define LDAP_OPT_SUCCESS 0
-#endif
-/* Solaris 8 and maybe other LDAP implementations spell this "..._INPROGRESS": */
-#if defined(LDAP_SASL_BIND_INPROGRESS) && !defined(LDAP_SASL_BIND_IN_PROGRESS)
-#define LDAP_SASL_BIND_IN_PROGRESS LDAP_SASL_BIND_INPROGRESS
-#endif
-/* Solaris 8 defines SSL_LDAP_PORT, not LDAPS_PORT and it only does so if
-   LDAP_SSL is defined - but SSL is not working. We just want the
-   port number! Let's just define LDAPS_PORT correct. */
-#if !defined(LDAPS_PORT)
-#define LDAPS_PORT 636
-#endif
-
-/* function declarations not included in proto.h */
-LDAP *ldap_open_with_timeout(const char *server, int port, unsigned int to);
-
-#else
+#ifndef HAVE_LDAP_H
 #undef HAVE_LDAP
 #endif
 
diff --git a/source3/include/smb_ldap.h b/source3/include/smb_ldap.h
new file mode 100644 (file)
index 0000000..45e5868
--- /dev/null
@@ -0,0 +1,58 @@
+#ifndef _SMB_LDAP_H
+#define _SMB_LDAP_H
+
+#if HAVE_LBER_H
+#include <lber.h>
+#if defined(HPUX) && !defined(_LBER_TYPES_H)
+/* Define ber_tag_t and ber_int_t for using
+ * HP LDAP-UX Integration products' LDAP libraries.
+*/
+#ifndef ber_tag_t
+typedef unsigned long ber_tag_t;
+typedef int ber_int_t;
+#endif
+#endif /* defined(HPUX) && !defined(_LBER_TYPES_H) */
+#ifndef LBER_USE_DER
+#define LBER_USE_DER 0x01
+#endif
+#endif /* HAVE_LBER_H */
+
+#if HAVE_LDAP_H
+#include <ldap.h>
+#ifndef LDAP_CONST
+#define LDAP_CONST const
+#endif
+#ifndef LDAP_OPT_SUCCESS
+#define LDAP_OPT_SUCCESS 0
+#endif
+/* Solaris 8 and maybe other LDAP implementations spell this "..._INPROGRESS": */
+#if defined(LDAP_SASL_BIND_INPROGRESS) && !defined(LDAP_SASL_BIND_IN_PROGRESS)
+#define LDAP_SASL_BIND_IN_PROGRESS LDAP_SASL_BIND_INPROGRESS
+#endif
+/* Solaris 8 defines SSL_LDAP_PORT, not LDAPS_PORT and it only does so if
+   LDAP_SSL is defined - but SSL is not working. We just want the
+   port number! Let's just define LDAPS_PORT correct. */
+#if !defined(LDAPS_PORT)
+#define LDAPS_PORT 636
+#endif
+
+/* function declarations not included in proto.h */
+LDAP *ldap_open_with_timeout(const char *server, int port, unsigned int to);
+
+#endif /* HAVE_LDAP_H */
+
+#ifndef HAVE_LDAP
+#define LDAP void
+#define LDAPMessage void
+#define LDAPMod void
+#define LDAP_CONST const
+#define LDAPControl void
+struct berval;
+struct ldapsam_privates;
+#endif /* HAVE_LDAP */
+
+#ifndef LDAP_OPT_SUCCESS
+#define LDAP_OPT_SUCCESS 0
+#endif
+
+#endif /* _SMB_LDAP_H */
index 3427ab54f68b3989727083a3a9e8669998962e1b..7872ce4d4bf6ca87bf9e30227a636b8876942412 100644 (file)
@@ -23,6 +23,8 @@
 
 struct smbldap_state;
 
+#include "smb_ldap.h"
+
 #ifdef HAVE_LDAP
 
 /* specify schema versions between 2.2. and 3.0 */
@@ -277,24 +279,12 @@ NTSTATUS smbldap_search_domain_info(struct smbldap_state *ldap_state,
                                     LDAPMessage ** result, const char *domain_name,
                                     bool try_add);
 
-#else
-#define LDAP void
-#define LDAPMessage void
-#define LDAPMod void
-#define LDAP_CONST const
-#define LDAPControl void
-struct berval;
-struct ldapsam_privates;
 #endif         /* HAVE_LDAP */
 
 #define LDAP_DEFAULT_TIMEOUT   15
 #define LDAP_CONNECTION_DEFAULT_TIMEOUT 2
 #define LDAP_PAGE_SIZE 1024
 
-#ifndef LDAP_OPT_SUCCESS
-#define LDAP_OPT_SUCCESS 0
-#endif
-
 #define ADS_PAGE_CTL_OID       "1.2.840.113556.1.4.319"
 
 /*
index 98623d1985c8b70e69cdf235f9ae4854c27473ac..27d9a20f61f31f83513b385c46a96026896eef1a 100644 (file)
@@ -18,6 +18,7 @@
  */
 
 #include "includes.h"
+#include "smb_ldap.h"
 
 #if defined(HAVE_LDAP) && defined(HAVE_LBER_LOG_PRINT_FN)
 static void samba_ldap_log_print_fn(LDAP_CONST char *data)
index 6680766f23f51f8c2435c292b0e3288e6c6a8236..b99464118debd45538043ae31b8fde741b4990dd 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "includes.h"
 #include "smb_krb5.h"
+#include "smb_ldap.h"
 
 /*
   build a ADS_STATUS structure
index 1ba2691a054b3f2ae6990da0ec5b5c2e019628ae..321965878d1f9b4105ecfad32b3abbe667aa993f 100644 (file)
@@ -20,6 +20,7 @@
 /* NT error codes.  please read nterr.h */
 
 #include "includes.h"
+#include "smb_ldap.h"
 #undef strcasecmp
 
 #if !defined(N_)
index a32c78f4e4d9005b42f36eb92d68722f8a52e145..3bb60a9f42144c1d22cd3deaba9c27f25709b037 100644 (file)
@@ -28,6 +28,7 @@
 #include "librpc/gen_ndr/wbint.h"
 
 #include "talloc_dict.h"
+#include "smb_ldap.h"
 
 #ifdef HAVE_LIBNSCD
 #include <libnscd.h>