svn commit: samba r19724 - in
branches/SAMBA_4_0/source/libcli/cldap: .
metze at samba.org
metze at samba.org
Wed Nov 15 17:08:45 GMT 2006
Author: metze
Date: 2006-11-15 17:08:45 +0000 (Wed, 15 Nov 2006)
New Revision: 19724
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=19724
Log:
add a helper functions to return an CLDAP error
metze
Modified:
branches/SAMBA_4_0/source/libcli/cldap/cldap.c
branches/SAMBA_4_0/source/libcli/cldap/cldap.h
Changeset:
Modified: branches/SAMBA_4_0/source/libcli/cldap/cldap.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/cldap/cldap.c 2006-11-15 17:01:26 UTC (rev 19723)
+++ branches/SAMBA_4_0/source/libcli/cldap/cldap.c 2006-11-15 17:08:45 UTC (rev 19724)
@@ -636,7 +636,35 @@
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
*/
Modified: branches/SAMBA_4_0/source/libcli/cldap/cldap.h
===================================================================
--- branches/SAMBA_4_0/source/libcli/cldap/cldap.h 2006-11-15 17:01:26 UTC (rev 19723)
+++ branches/SAMBA_4_0/source/libcli/cldap/cldap.h 2006-11-15 17:08:45 UTC (rev 19724)
@@ -135,6 +135,15 @@
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 @@
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,
More information about the samba-cvs
mailing list