From a427652010820fdf8fa82cf425f5162cc70348e0 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 26 Apr 2011 13:53:45 +1000 Subject: s3-libads: Use ldap_init_fd() to connect to AD server in socket_wrapper This means that we control the connection setup, don't rely on signals for timeouts and the connection uses socket_wrapper where that is required in our test environment. According to bug reports, this method is also used by curl and other tools, so we are not the first to (ab)use the OpenLDAP libs in this way. It is ONLY enabled for socket_wrapper at this time, as this is the best way to get 'make test' working for S3 winbind tests in an S4 domain. Andrew Bartlett --- source3/include/smb_ldap.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source3/include/smb_ldap.h') diff --git a/source3/include/smb_ldap.h b/source3/include/smb_ldap.h index 45e586859db..7165de19bf3 100644 --- a/source3/include/smb_ldap.h +++ b/source3/include/smb_ldap.h @@ -37,7 +37,14 @@ typedef int ber_int_t; #endif /* function declarations not included in proto.h */ -LDAP *ldap_open_with_timeout(const char *server, int port, unsigned int to); +LDAP *ldap_open_with_timeout(const char *server, + struct sockaddr_storage *ss, + int port, unsigned int to); + +#ifdef HAVE_LDAP_PVT_H +#include +#endif +int ldap_init_fd(ber_socket_t fd, int proto, char *uri, LDAP **ldp); #endif /* HAVE_LDAP_H */ -- cgit From a3ec6052f90562a1e973ca7fc8a2acf9f41de7f0 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 28 Apr 2011 15:49:21 +1000 Subject: s3-ldap Move ldap prototypes to inside #ifdef HAVE_LDAP_H This fixes the build without LDAP development headers. --- source3/include/smb_ldap.h | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'source3/include/smb_ldap.h') diff --git a/source3/include/smb_ldap.h b/source3/include/smb_ldap.h index 7165de19bf3..613f6dcac48 100644 --- a/source3/include/smb_ldap.h +++ b/source3/include/smb_ldap.h @@ -22,6 +22,17 @@ typedef int ber_int_t; #ifndef LDAP_CONST #define LDAP_CONST const #endif + +#ifdef HAVE_LDAP_PVT_H +#include +#endif /* HAVE_LDAP_PVT_H */ +int ldap_init_fd(ber_socket_t fd, int proto, char *uri, LDAP **ldp); + +/* 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 @@ -36,16 +47,6 @@ typedef int ber_int_t; #define LDAPS_PORT 636 #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); - -#ifdef HAVE_LDAP_PVT_H -#include -#endif -int ldap_init_fd(ber_socket_t fd, int proto, char *uri, LDAP **ldp); - #endif /* HAVE_LDAP_H */ #ifndef HAVE_LDAP -- cgit From 4d41a5effdc9a13921367be3412b53a39f75d73a Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 29 Apr 2011 18:43:30 +1000 Subject: s3-ldap Only prototype ldap_init_fd() when we have found it in the libraries Autobuild-User: Andrew Bartlett Autobuild-Date: Fri Apr 29 11:47:07 CEST 2011 on sn-devel-104 --- source3/include/smb_ldap.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/include/smb_ldap.h') diff --git a/source3/include/smb_ldap.h b/source3/include/smb_ldap.h index 613f6dcac48..389a7342273 100644 --- a/source3/include/smb_ldap.h +++ b/source3/include/smb_ldap.h @@ -26,7 +26,10 @@ typedef int ber_int_t; #ifdef HAVE_LDAP_PVT_H #include #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, -- cgit From e14b60c7ee6a76c444f12b8987740602c7b5f1d3 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 10 Jun 2011 15:04:26 +0200 Subject: source3/include/smb_ldap.h: fix licence/copyright Guenther --- source3/include/smb_ldap.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'source3/include/smb_ldap.h') diff --git a/source3/include/smb_ldap.h b/source3/include/smb_ldap.h index 389a7342273..594f0158629 100644 --- a/source3/include/smb_ldap.h +++ b/source3/include/smb_ldap.h @@ -1,3 +1,25 @@ +/* + Unix SMB/CIFS implementation. + Copyright (C) Andrew Tridgell 2001 + Copyright (C) Remus Koos 2001 + Copyright (C) Jim McDonough 2002 + Copyright (C) Guenther Deschner 2005 + Copyright (C) Gerald Carter 2006 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #ifndef _SMB_LDAP_H #define _SMB_LDAP_H -- cgit