summaryrefslogtreecommitdiff
path: root/source4/libcli/cldap/cldap.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-11-15 17:08:45 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:28:14 -0500
commit146a4ff13a56ac5d72203adbf47c6cd53e892b32 (patch)
treea56dda806dbafea69f494951aa0389b0453cc22f /source4/libcli/cldap/cldap.c
parenta4957315d89f99ca3bac2df816a4f3f6a0b83c93 (diff)
downloadsamba-146a4ff13a56ac5d72203adbf47c6cd53e892b32.tar.gz
samba-146a4ff13a56ac5d72203adbf47c6cd53e892b32.tar.bz2
samba-146a4ff13a56ac5d72203adbf47c6cd53e892b32.zip
r19724: add a helper functions to return an CLDAP error
metze (This used to be commit 0a1ecb911656f8170708ce13e1183557fe118794)
Diffstat (limited to 'source4/libcli/cldap/cldap.c')
-rw-r--r--source4/libcli/cldap/cldap.c28
1 files changed, 28 insertions, 0 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