summaryrefslogtreecommitdiff
path: root/source4/libcli/cldap
diff options
context:
space:
mode:
Diffstat (limited to 'source4/libcli/cldap')
-rw-r--r--source4/libcli/cldap/cldap.c28
-rw-r--r--source4/libcli/cldap/cldap.h14
2 files changed, 37 insertions, 5 deletions
diff --git a/source4/libcli/cldap/cldap.c b/source4/libcli/cldap/cldap.c
index 1b09272f04..94887ef697 100644
--- a/source4/libcli/cldap/cldap.c
+++ b/source4/libcli/cldap/cldap.c
@@ -636,6 +636,34 @@ NTSTATUS cldap_empty_reply(struct cldap_socket *cldap,
return status;
}
+/*
+ send an error reply (used on any error, so the client doesn't keep waiting
+ or send the bad request again)
+*/
+NTSTATUS cldap_error_reply(struct cldap_socket *cldap,
+ uint32_t message_id,
+ struct socket_address *src,
+ int resultcode,
+ const char *errormessage)
+{
+ NTSTATUS status;
+ struct cldap_reply reply;
+ struct ldap_Result result;
+
+ reply.messageid = message_id;
+ reply.dest = src;
+ reply.response = NULL;
+ reply.result = &result;
+
+ ZERO_STRUCT(result);
+ result.resultcode = resultcode;
+ result.errormessage = errormessage;
+
+ status = cldap_reply_send(cldap, &reply);
+
+ return status;
+}
+
/*
send a netlogon reply
diff --git a/source4/libcli/cldap/cldap.h b/source4/libcli/cldap/cldap.h
index 98cb54dded..8bae2aa41b 100644
--- a/source4/libcli/cldap/cldap.h
+++ b/source4/libcli/cldap/cldap.h
@@ -135,6 +135,15 @@ struct cldap_reply {
NTSTATUS cldap_reply_send(struct cldap_socket *cldap, struct cldap_reply *io);
+NTSTATUS cldap_empty_reply(struct cldap_socket *cldap,
+ uint32_t message_id,
+ struct socket_address *src);
+NTSTATUS cldap_error_reply(struct cldap_socket *cldap,
+ uint32_t message_id,
+ struct socket_address *src,
+ int resultcode,
+ const char *errormessage);
+
/*
a netlogon cldap request
*/
@@ -161,11 +170,6 @@ NTSTATUS cldap_netlogon_recv(struct cldap_request *req,
struct cldap_netlogon *io);
NTSTATUS cldap_netlogon(struct cldap_socket *cldap,
TALLOC_CTX *mem_ctx, struct cldap_netlogon *io);
-
-
-NTSTATUS cldap_empty_reply(struct cldap_socket *cldap,
- uint32_t message_id,
- struct socket_address *src);
NTSTATUS cldap_netlogon_reply(struct cldap_socket *cldap,
uint32_t message_id,
struct socket_address *src,