The branch, master has been updated via 8a4c8e3 s3-smbldap: move ldap_open_with_timeout out of smb_ldap.h to ads where it lives. via 8eb0747 s3-smbldap: remove duplicate LDAP_OPT_SUCCESS define. via 21691b3 s3-winbindd: no need to globally include ldap headers in winbindd. via 7de6e6f s3-smbldap: include talloc.h and tevent.h in smbldap.h via 667f8a2 s3-param: loadparm has no dependency to smbldap. via f9df88e s3-smbldap: improve smbldap.h readability and rearrange some defines. via 7d71747 s3-smbldap: remove duplicate prototype. from 2de232a s3-nmbd Remove AD netlogon response from s3 nmbd server
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 8a4c8e3f8527015c4c5c32abda20ceddb6eb2f0f Author: Günther Deschner <g...@samba.org> Date: Thu Nov 17 00:55:04 2011 +0100 s3-smbldap: move ldap_open_with_timeout out of smb_ldap.h to ads where it lives. Guenther Autobuild-User: Günther Deschner <g...@samba.org> Autobuild-Date: Thu Nov 17 03:47:53 CET 2011 on sn-devel-104 commit 8eb0747c1a061853faf1f3734e0e9b1a2c36dd9f Author: Günther Deschner <g...@samba.org> Date: Thu Nov 17 00:44:41 2011 +0100 s3-smbldap: remove duplicate LDAP_OPT_SUCCESS define. Guenther commit 21691b38bcbdd885e33b1555a19bac0903952396 Author: Günther Deschner <g...@samba.org> Date: Wed Nov 16 22:53:24 2011 +0100 s3-winbindd: no need to globally include ldap headers in winbindd. Guenther commit 7de6e6fbc78e149200903b054206b56425e44562 Author: Günther Deschner <g...@samba.org> Date: Wed Nov 16 22:50:18 2011 +0100 s3-smbldap: include talloc.h and tevent.h in smbldap.h Guenther commit 667f8a244d5a78c47b958c5dd9d70dbe54ce59ec Author: Günther Deschner <g...@samba.org> Date: Wed Nov 16 19:31:34 2011 +0100 s3-param: loadparm has no dependency to smbldap. Guenther commit f9df88eca7b9cdd2dda5bbd8700072a28e151b86 Author: Günther Deschner <g...@samba.org> Date: Wed Nov 16 18:59:26 2011 +0100 s3-smbldap: improve smbldap.h readability and rearrange some defines. Guenther commit 7d71747897b9b7c0119796ea874b464d73b00de8 Author: Günther Deschner <g...@samba.org> Date: Wed Nov 16 18:54:02 2011 +0100 s3-smbldap: remove duplicate prototype. Guenther ----------------------------------------------------------------------- Summary of changes: source3/include/smb_ldap.h | 43 +++++++++++++----- source3/include/smbldap.h | 88 ++++++++++--------------------------- source3/libads/ads_ldap_protos.h | 7 +++ source3/param/loadparm.c | 1 - source3/passdb/pdb_ldap_util.c | 1 + source3/winbindd/winbindd.h | 1 - source3/winbindd/winbindd_msrpc.c | 2 +- 7 files changed, 64 insertions(+), 79 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/include/smb_ldap.h b/source3/include/smb_ldap.h index 594f015..eaa1276 100644 --- a/source3/include/smb_ldap.h +++ b/source3/include/smb_ldap.h @@ -49,18 +49,6 @@ typedef int ber_int_t; #include <ldap_pvt.h> #endif /* HAVE_LDAP_PVT_H */ -#ifdef HAVE_LDAP_INIT_FD -int ldap_init_fd(ber_socket_t fd, int proto, char *uri, LDAP **ldp); -#endif - -/* function declarations not included in proto.h */ -LDAP *ldap_open_with_timeout(const char *server, - struct sockaddr_storage *ss, - int port, unsigned int to); - -#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 @@ -88,4 +76,35 @@ struct ldapsam_privates; #define LDAP_OPT_SUCCESS 0 #endif +#define LDAP_DEFAULT_TIMEOUT 15 +#define LDAP_CONNECTION_DEFAULT_TIMEOUT 2 +#define LDAP_PAGE_SIZE 1024 + +#define ADS_PAGE_CTL_OID "1.2.840.113556.1.4.319" + +/* + * Work around versions of the LDAP client libs that don't have the OIDs + * defined, or have them defined under the old name. + * This functionality is really a factor of the server, not the client + * + */ + +#if defined(LDAP_EXOP_X_MODIFY_PASSWD) && !defined(LDAP_EXOP_MODIFY_PASSWD) +#define LDAP_EXOP_MODIFY_PASSWD LDAP_EXOP_X_MODIFY_PASSWD +#elif !defined(LDAP_EXOP_MODIFY_PASSWD) +#define LDAP_EXOP_MODIFY_PASSWD "1.3.6.1.4.1.4203.1.11.1" +#endif + +#if defined(LDAP_EXOP_X_MODIFY_PASSWD_ID) && !defined(LDAP_EXOP_MODIFY_PASSWD_ID) +#define LDAP_TAG_EXOP_MODIFY_PASSWD_ID LDAP_EXOP_X_MODIFY_PASSWD_ID +#elif !defined(LDAP_EXOP_MODIFY_PASSWD_ID) +#define LDAP_TAG_EXOP_MODIFY_PASSWD_ID ((ber_tag_t) 0x80U) +#endif + +#if defined(LDAP_EXOP_X_MODIFY_PASSWD_NEW) && !defined(LDAP_EXOP_MODIFY_PASSWD_NEW) +#define LDAP_TAG_EXOP_MODIFY_PASSWD_NEW LDAP_EXOP_X_MODIFY_PASSWD_NEW +#elif !defined(LDAP_EXOP_MODIFY_PASSWD_NEW) +#define LDAP_TAG_EXOP_MODIFY_PASSWD_NEW ((ber_tag_t) 0x82U) +#endif + #endif /* _SMB_LDAP_H */ diff --git a/source3/include/smbldap.h b/source3/include/smbldap.h index d8f12bc..df9df76 100644 --- a/source3/include/smbldap.h +++ b/source3/include/smbldap.h @@ -21,37 +21,12 @@ #ifndef _SMBLDAP_H #define _SMBLDAP_H -struct smbldap_state; - #include "include/smb_ldap.h" #ifdef HAVE_LDAP -/* Function declarations -- not included in proto.h so we don't - have to worry about LDAP structure types */ - -NTSTATUS smbldap_init(TALLOC_CTX *mem_ctx, - struct tevent_context *tevent_ctx, - const char *location, - bool anon, - const char *bind_dn, - const char *bind_secret, - struct smbldap_state **smbldap_state); - -void smbldap_set_mod (LDAPMod *** modlist, int modop, const char *attribute, const char *value); -void smbldap_set_mod_blob(LDAPMod *** modlist, int modop, const char *attribute, const DATA_BLOB *newblob); -void smbldap_make_mod(LDAP *ldap_struct, LDAPMessage *existing, - LDAPMod ***mods, - const char *attribute, const char *newval); -void smbldap_make_mod_blob(LDAP *ldap_struct, LDAPMessage *existing, - LDAPMod ***mods, - const char *attribute, const DATA_BLOB *newblob); -bool smbldap_get_single_attribute (LDAP * ldap_struct, LDAPMessage * entry, - const char *attribute, char *value, - int max_len); -int smbldap_modify(struct smbldap_state *ldap_state, - const char *dn, - LDAPMod *attrs[]); +#include <talloc.h> +#include <tevent.h> /** * Struct to keep the state for all the ldap stuff @@ -119,6 +94,28 @@ struct ldapsam_privates { /* The following definitions come from lib/smbldap.c */ +NTSTATUS smbldap_init(TALLOC_CTX *mem_ctx, + struct tevent_context *tevent_ctx, + const char *location, + bool anon, + const char *bind_dn, + const char *bind_secret, + struct smbldap_state **smbldap_state); + +void smbldap_set_mod (LDAPMod *** modlist, int modop, const char *attribute, const char *value); +void smbldap_set_mod_blob(LDAPMod *** modlist, int modop, const char *attribute, const DATA_BLOB *newblob); +void smbldap_make_mod(LDAP *ldap_struct, LDAPMessage *existing, + LDAPMod ***mods, + const char *attribute, const char *newval); +void smbldap_make_mod_blob(LDAP *ldap_struct, LDAPMessage *existing, + LDAPMod ***mods, + const char *attribute, const DATA_BLOB *newblob); +bool smbldap_get_single_attribute (LDAP * ldap_struct, LDAPMessage * entry, + const char *attribute, char *value, + int max_len); +int smbldap_modify(struct smbldap_state *ldap_state, + const char *dn, + LDAPMod *attrs[]); int smb_ldap_start_tls(LDAP *ldap_struct, int version); int smb_ldap_setup_full_conn(LDAP **ldap_struct, const char *uri); int smbldap_search(struct smbldap_state *ldap_state, @@ -163,43 +160,6 @@ void talloc_autofree_ldapmod(TALLOC_CTX *mem_ctx, LDAPMod **mod); char *smbldap_talloc_dn(TALLOC_CTX *mem_ctx, LDAP *ld, LDAPMessage *entry); -/* The following definitions come from lib/smbldap_util.c */ - -NTSTATUS smbldap_search_domain_info(struct smbldap_state *ldap_state, - LDAPMessage ** result, const char *domain_name, - bool try_add); - #endif /* HAVE_LDAP */ -#define LDAP_DEFAULT_TIMEOUT 15 -#define LDAP_CONNECTION_DEFAULT_TIMEOUT 2 -#define LDAP_PAGE_SIZE 1024 - -#define ADS_PAGE_CTL_OID "1.2.840.113556.1.4.319" - -/* - * Work around versions of the LDAP client libs that don't have the OIDs - * defined, or have them defined under the old name. - * This functionality is really a factor of the server, not the client - * - */ - -#if defined(LDAP_EXOP_X_MODIFY_PASSWD) && !defined(LDAP_EXOP_MODIFY_PASSWD) -#define LDAP_EXOP_MODIFY_PASSWD LDAP_EXOP_X_MODIFY_PASSWD -#elif !defined(LDAP_EXOP_MODIFY_PASSWD) -#define LDAP_EXOP_MODIFY_PASSWD "1.3.6.1.4.1.4203.1.11.1" -#endif - -#if defined(LDAP_EXOP_X_MODIFY_PASSWD_ID) && !defined(LDAP_EXOP_MODIFY_PASSWD_ID) -#define LDAP_TAG_EXOP_MODIFY_PASSWD_ID LDAP_EXOP_X_MODIFY_PASSWD_ID -#elif !defined(LDAP_EXOP_MODIFY_PASSWD_ID) -#define LDAP_TAG_EXOP_MODIFY_PASSWD_ID ((ber_tag_t) 0x80U) -#endif - -#if defined(LDAP_EXOP_X_MODIFY_PASSWD_NEW) && !defined(LDAP_EXOP_MODIFY_PASSWD_NEW) -#define LDAP_TAG_EXOP_MODIFY_PASSWD_NEW LDAP_EXOP_X_MODIFY_PASSWD_NEW -#elif !defined(LDAP_EXOP_MODIFY_PASSWD_NEW) -#define LDAP_TAG_EXOP_MODIFY_PASSWD_NEW ((ber_tag_t) 0x82U) -#endif - #endif /* _SMBLDAP_H */ diff --git a/source3/libads/ads_ldap_protos.h b/source3/libads/ads_ldap_protos.h index 0fb7134..83b6fc1 100644 --- a/source3/libads/ads_ldap_protos.h +++ b/source3/libads/ads_ldap_protos.h @@ -24,10 +24,17 @@ #ifndef _LIBADS_ADS_LDAP_PROTOS_H_ #define _LIBADS_ADS_LDAP_PROTOS_H_ +#ifdef HAVE_LDAP_INIT_FD +int ldap_init_fd(ber_socket_t fd, int proto, char *uri, LDAP **ldp); +#endif + /* * Prototypes for ads */ +LDAP *ldap_open_with_timeout(const char *server, + struct sockaddr_storage *ss, + int port, unsigned int to); void ads_msgfree(ADS_STRUCT *ads, LDAPMessage *msg); char *ads_get_dn(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, LDAPMessage *msg); diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index c044f65..d406483 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -67,7 +67,6 @@ #include "../libcli/smb/smb_signing.h" #include "dbwrap/dbwrap.h" #include "dbwrap/dbwrap_rbt.h" -#include "smbldap.h" #include "../lib/util/bitmap.h" #ifdef HAVE_SYS_SYSCTL_H diff --git a/source3/passdb/pdb_ldap_util.c b/source3/passdb/pdb_ldap_util.c index 4965b9f..4c86201 100644 --- a/source3/passdb/pdb_ldap_util.c +++ b/source3/passdb/pdb_ldap_util.c @@ -25,6 +25,7 @@ #include "includes.h" #include "smbldap.h" #include "passdb.h" +#include "passdb/pdb_ldap_util.h" #include "passdb/pdb_ldap_schema.h" /********************************************************************** diff --git a/source3/winbindd/winbindd.h b/source3/winbindd/winbindd.h index 3f1c7f5..33c7bbe 100644 --- a/source3/winbindd/winbindd.h +++ b/source3/winbindd/winbindd.h @@ -28,7 +28,6 @@ #include "librpc/gen_ndr/wbint.h" #include "talloc_dict.h" -#include "smb_ldap.h" #include "../lib/util/tevent_ntstatus.h" diff --git a/source3/winbindd/winbindd_msrpc.c b/source3/winbindd/winbindd_msrpc.c index 094b025..455de3d 100644 --- a/source3/winbindd/winbindd_msrpc.c +++ b/source3/winbindd/winbindd_msrpc.c @@ -769,7 +769,7 @@ static NTSTATUS msrpc_lookup_groupmem(struct winbindd_domain *domain, #ifdef HAVE_LDAP -#include <ldap.h> +#include "ads.h" static int get_ldap_seq(const char *server, struct sockaddr_storage *ss, int port, uint32 *seq) { -- Samba Shared Repository