summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/include/includes.h1
-rw-r--r--source4/include/structs.h2
-rw-r--r--source4/ldap_server/ldap_backend.c5
-rw-r--r--source4/ldap_server/ldap_bind.c1
-rw-r--r--source4/ldap_server/ldap_server.h2
-rw-r--r--source4/libcli/ldap/config.mk1
-rw-r--r--source4/libcli/ldap/ldap.c1
-rw-r--r--source4/libcli/ldap/ldap.h59
-rw-r--r--source4/libcli/ldap/ldap_client.c1
-rw-r--r--source4/libcli/ldap/ldap_ldif.c1
-rw-r--r--source4/torture/ldap/basic.c1
-rw-r--r--source4/torture/ldap/common.c1
12 files changed, 73 insertions, 3 deletions
diff --git a/source4/include/includes.h b/source4/include/includes.h
index cfc0a26260..b31ba4d840 100644
--- a/source4/include/includes.h
+++ b/source4/include/includes.h
@@ -122,7 +122,6 @@ extern int errno;
#include "enums.h"
#include "smb_macros.h"
#include "smb.h"
-#include "libcli/ldap/ldap.h"
#include "byteorder.h"
#include "module.h"
#include "mutex.h"
diff --git a/source4/include/structs.h b/source4/include/structs.h
index f376609302..29d552d3cc 100644
--- a/source4/include/structs.h
+++ b/source4/include/structs.h
@@ -74,6 +74,8 @@ struct asn1_data;
struct ldapsrv_call;
struct ldapsrv_connection;
+struct ldap_connection;
+struct ldap_message;
struct rw_buffer;
struct registry_context;
struct registry_key;
diff --git a/source4/ldap_server/ldap_backend.c b/source4/ldap_server/ldap_backend.c
index 58c6dde436..d87ea657d7 100644
--- a/source4/ldap_server/ldap_backend.c
+++ b/source4/ldap_server/ldap_backend.c
@@ -21,9 +21,10 @@
#include "includes.h"
#include "ldap_server/ldap_server.h"
#include "dlinklist.h"
+#include "libcli/ldap/ldap.h"
-struct ldapsrv_reply *ldapsrv_init_reply(struct ldapsrv_call *call, enum ldap_request_tag type)
+struct ldapsrv_reply *ldapsrv_init_reply(struct ldapsrv_call *call, uint8_t type)
{
struct ldapsrv_reply *reply;
@@ -47,7 +48,7 @@ NTSTATUS ldapsrv_queue_reply(struct ldapsrv_call *call, struct ldapsrv_reply *re
return NT_STATUS_OK;
}
-struct ldapsrv_partition *ldapsrv_get_partition(struct ldapsrv_connection *conn, const char *dn, enum ldap_scope scope)
+struct ldapsrv_partition *ldapsrv_get_partition(struct ldapsrv_connection *conn, const char *dn, uint8_t scope)
{
if (scope == LDAP_SEARCH_SCOPE_BASE
&& strcasecmp("", dn) == 0) {
diff --git a/source4/ldap_server/ldap_bind.c b/source4/ldap_server/ldap_bind.c
index f397b7611b..d6b0332b6e 100644
--- a/source4/ldap_server/ldap_bind.c
+++ b/source4/ldap_server/ldap_bind.c
@@ -21,6 +21,7 @@
#include "includes.h"
#include "ldap_server/ldap_server.h"
#include "auth/auth.h"
+#include "libcli/ldap/ldap.h"
static NTSTATUS ldapsrv_BindSimple(struct ldapsrv_call *call)
{
diff --git a/source4/ldap_server/ldap_server.h b/source4/ldap_server/ldap_server.h
index 39052a7671..0a16394c09 100644
--- a/source4/ldap_server/ldap_server.h
+++ b/source4/ldap_server/ldap_server.h
@@ -19,6 +19,8 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include "libcli/ldap/ldap.h"
+
struct rw_buffer {
uint8_t *data;
size_t ofs, length;
diff --git a/source4/libcli/ldap/config.mk b/source4/libcli/ldap/config.mk
index 284edfd95e..87bfdfdbba 100644
--- a/source4/libcli/ldap/config.mk
+++ b/source4/libcli/ldap/config.mk
@@ -4,5 +4,6 @@
ADD_OBJ_FILES = libcli/ldap/ldap.o \
libcli/ldap/ldap_client.o \
libcli/ldap/ldap_ldif.o
+NOPROTO=YES
# End SUBSYSTEM LIBCLI_LDAP
#################################
diff --git a/source4/libcli/ldap/ldap.c b/source4/libcli/ldap/ldap.c
index 545759c494..4b449e5123 100644
--- a/source4/libcli/ldap/ldap.c
+++ b/source4/libcli/ldap/ldap.c
@@ -27,6 +27,7 @@
#include "system/iconv.h"
#include "system/filesys.h"
#include "asn_1.h"
+#include "libcli/ldap/ldap.h"
/****************************************************************************
*
diff --git a/source4/libcli/ldap/ldap.h b/source4/libcli/ldap/ldap.h
index 8947562b77..3e51e4f60f 100644
--- a/source4/libcli/ldap/ldap.h
+++ b/source4/libcli/ldap/ldap.h
@@ -317,4 +317,63 @@ struct ldap_parse_tree {
#define LDAP_ALL_SEP "()&|=!"
#define LDAP_CONNECTION_TIMEOUT 10000
+/* The following definitions come from libcli/ldap/ldap.c */
+
+BOOL ldap_encode(struct ldap_message *msg, DATA_BLOB *result);
+BOOL ldap_decode(struct asn1_data *data, struct ldap_message *msg);
+BOOL ldap_parse_basic_url(TALLOC_CTX *mem_ctx, const char *url,
+ char **host, uint16_t *port, BOOL *ldaps);
+
+/* The following definitions come from libcli/ldap/ldap_client.c */
+
+struct ldap_connection *ldap_connect(TALLOC_CTX *mem_ctx, const char *url);
+struct ldap_message *new_ldap_message(TALLOC_CTX *mem_ctx);
+BOOL ldap_send_msg(struct ldap_connection *conn, struct ldap_message *msg,
+ const struct timeval *endtime);
+BOOL ldap_receive_msg(struct ldap_connection *conn, struct ldap_message *msg,
+ const struct timeval *endtime);
+struct ldap_message *ldap_receive(struct ldap_connection *conn, int msgid,
+ const struct timeval *endtime);
+struct ldap_message *ldap_transaction(struct ldap_connection *conn,
+ struct ldap_message *request);
+int ldap_bind_simple(struct ldap_connection *conn, const char *userdn, const char *password);
+int ldap_bind_sasl(struct ldap_connection *conn, const char *username, const char *domain, const char *password);
+struct ldap_connection *ldap_setup_connection(TALLOC_CTX *mem_ctx, const char *url,
+ const char *userdn, const char *password);
+struct ldap_connection *ldap_setup_connection_with_sasl(TALLOC_CTX *mem_ctx, const char *url,
+ const char *username, const char *domain, const char *password);
+BOOL ldap_abandon_message(struct ldap_connection *conn, int msgid,
+ const struct timeval *endtime);
+BOOL ldap_setsearchent(struct ldap_connection *conn, struct ldap_message *msg,
+ const struct timeval *endtime);
+struct ldap_message *ldap_getsearchent(struct ldap_connection *conn,
+ const struct timeval *endtime);
+void ldap_endsearchent(struct ldap_connection *conn,
+ const struct timeval *endtime);
+struct ldap_message *ldap_searchone(struct ldap_connection *conn,
+ struct ldap_message *msg,
+ const struct timeval *endtime);
+BOOL ldap_find_single_value(struct ldap_message *msg, const char *attr,
+ DATA_BLOB *value);
+BOOL ldap_find_single_string(struct ldap_message *msg, const char *attr,
+ TALLOC_CTX *mem_ctx, char **value);
+BOOL ldap_find_single_int(struct ldap_message *msg, const char *attr,
+ int *value);
+int ldap_error(struct ldap_connection *conn);
+NTSTATUS ldap2nterror(int ldaperror);
+
+/* The following definitions come from libcli/ldap/ldap_ldif.c */
+
+BOOL add_value_to_attrib(TALLOC_CTX *mem_ctx, struct ldap_val *value,
+ struct ldap_attribute *attrib);
+BOOL add_attrib_to_array_talloc(TALLOC_CTX *mem_ctx,
+ const struct ldap_attribute *attrib,
+ struct ldap_attribute **attribs,
+ int *num_attribs);
+BOOL add_mod_to_array_talloc(TALLOC_CTX *mem_ctx,
+ struct ldap_mod *mod,
+ struct ldap_mod **mods,
+ int *num_mods);
+struct ldap_message *ldap_ldif2msg(TALLOC_CTX *mem_ctx, const char *s);
+
#endif
diff --git a/source4/libcli/ldap/ldap_client.c b/source4/libcli/ldap/ldap_client.c
index ddf0932fa1..11815ddd6d 100644
--- a/source4/libcli/ldap/ldap_client.c
+++ b/source4/libcli/ldap/ldap_client.c
@@ -29,6 +29,7 @@
#include "auth/auth.h"
#include "asn_1.h"
#include "dlinklist.h"
+#include "libcli/ldap/ldap.h"
diff --git a/source4/libcli/ldap/ldap_ldif.c b/source4/libcli/ldap/ldap_ldif.c
index a0249a4ba0..e5e5cdd6df 100644
--- a/source4/libcli/ldap/ldap_ldif.c
+++ b/source4/libcli/ldap/ldap_ldif.c
@@ -25,6 +25,7 @@
#include "includes.h"
#include "system/iconv.h"
+#include "libcli/ldap/ldap.h"
/****************************************************************************
*
diff --git a/source4/torture/ldap/basic.c b/source4/torture/ldap/basic.c
index 99f79c8c50..936a8dbe51 100644
--- a/source4/torture/ldap/basic.c
+++ b/source4/torture/ldap/basic.c
@@ -22,6 +22,7 @@
*/
#include "includes.h"
+#include "libcli/ldap/ldap.h"
BOOL test_bind_simple(struct ldap_connection *conn, const char *userdn, const char *password)
{
diff --git a/source4/torture/ldap/common.c b/source4/torture/ldap/common.c
index b9f0f5c655..f421565cbd 100644
--- a/source4/torture/ldap/common.c
+++ b/source4/torture/ldap/common.c
@@ -23,6 +23,7 @@
#include "includes.h"
#include "asn_1.h"
+#include "libcli/ldap/ldap.h"
NTSTATUS torture_ldap_bind(struct ldap_connection *conn, const char *userdn, const char *password)
{