summaryrefslogtreecommitdiff
path: root/source4/cldap_server/cldap_server.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-05-12 08:28:07 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:16:41 -0500
commit2279d1ebfb0a750d92ca0c4a9dc9803c35c845d9 (patch)
tree99ce0413de698eff236186dae6c1756e9bd9dfc7 /source4/cldap_server/cldap_server.c
parent59f415c0ed93cfe5f3e4d3e8d95006109b236796 (diff)
downloadsamba-2279d1ebfb0a750d92ca0c4a9dc9803c35c845d9.tar.gz
samba-2279d1ebfb0a750d92ca0c4a9dc9803c35c845d9.tar.bz2
samba-2279d1ebfb0a750d92ca0c4a9dc9803c35c845d9.zip
r6747: first working version of cldapd server. It is missing 'sites' support, and
filling in some of the returned parameters is quite rough, but it seems to work OK (This used to be commit e564e3e596915414fad07c94f7ea8a0d9c3a1140)
Diffstat (limited to 'source4/cldap_server/cldap_server.c')
-rw-r--r--source4/cldap_server/cldap_server.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/source4/cldap_server/cldap_server.c b/source4/cldap_server/cldap_server.c
index 8397a624c0..ad4779da01 100644
--- a/source4/cldap_server/cldap_server.c
+++ b/source4/cldap_server/cldap_server.c
@@ -27,7 +27,6 @@
#include "smbd/service_task.h"
#include "cldap_server/cldap_server.h"
-
/*
handle incoming cldap requests
*/
@@ -35,16 +34,27 @@ static void cldapd_request_handler(struct cldap_socket *cldap,
struct ldap_message *ldap_msg,
const char *src_address, int src_port)
{
- struct cldapd_server *cldapd = talloc_get_type(cldap->incoming.private,
- struct cldapd_server);
+ struct ldap_SearchRequest *search;
if (ldap_msg->type != LDAP_TAG_SearchRequest) {
DEBUG(0,("Invalid CLDAP request type %d from %s:%d\n",
ldap_msg->type, src_address, src_port));
return;
}
- DEBUG(0,("CLDAP search for '%s'\n", ldap_msg->r.SearchRequest.filter));
+
+ search = &ldap_msg->r.SearchRequest;
+
+ if (search->num_attributes == 1 &&
+ strcasecmp(search->attributes[0], "netlogon") == 0) {
+ cldapd_netlogon_request(cldap, ldap_msg->messageid,
+ search->filter, src_address, src_port);
+ } else {
+ DEBUG(0,("Unknown CLDAP search for '%s'\n",
+ ldap_msg->r.SearchRequest.filter));
+ cldap_empty_reply(cldap, ldap_msg->messageid, src_address, src_port);
+ }
}
+
/*
start listening on the given address
*/
@@ -81,7 +91,7 @@ NTSTATUS cldapd_startup_interfaces(struct cldapd_server *cldapd)
NTSTATUS status;
/* if we are allowing incoming packets from any address, then
- we also need to bind to the wildcard address */
+ we need to bind to the wildcard address */
if (!lp_bind_interfaces_only()) {
status = cldapd_add_socket(cldapd, "0.0.0.0");
NT_STATUS_NOT_OK_RETURN(status);