summaryrefslogtreecommitdiff
path: root/source4/nbt_server
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2008-05-17 20:53:29 +1000
committerAndrew Bartlett <abartlet@samba.org>2008-05-17 20:53:29 +1000
commitfd0d47b746be322b60fca29c1daa13e72b360e62 (patch)
tree4f8cb55d4a4a001001b2397284800f7cfe8e0645 /source4/nbt_server
parent24264e9acb12938f666bcdfc92ee4f9ed6409112 (diff)
downloadsamba-fd0d47b746be322b60fca29c1daa13e72b360e62.tar.gz
samba-fd0d47b746be322b60fca29c1daa13e72b360e62.tar.bz2
samba-fd0d47b746be322b60fca29c1daa13e72b360e62.zip
Handle netbios domains in the CLDAP server too.
This commit also fixes a number of issues found by the NBT-DGRAM and LDAP-CLDAP tests. Andrew Bartlett (This used to be commit 8f99a4b94e95f8bde0f80f92d4e57020c62cfaab)
Diffstat (limited to 'source4/nbt_server')
-rw-r--r--source4/nbt_server/dgram/netlogon.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/source4/nbt_server/dgram/netlogon.c b/source4/nbt_server/dgram/netlogon.c
index ae24a7cd2b..c66089523b 100644
--- a/source4/nbt_server/dgram/netlogon.c
+++ b/source4/nbt_server/dgram/netlogon.c
@@ -30,6 +30,7 @@
#include "param/param.h"
#include "smbd/service_task.h"
#include "cldap_server/cldap_server.h"
+#include "libcli/security/security.h"
/*
reply to a GETDC request
@@ -51,8 +52,8 @@ static void nbtd_netlogon_getdc(struct dgram_mailslot_handler *dgmslot,
struct nbt_netlogon_response netlogon_response;
int ret;
- /* only answer getdc requests on the PDC name */
- if (name->type != NBT_NAME_PDC) {
+ /* only answer getdc requests on the PDC or LOGON names */
+ if (name->type != NBT_NAME_PDC && name->type != NBT_NAME_LOGON) {
return;
}
@@ -62,6 +63,11 @@ static void nbtd_netlogon_getdc(struct dgram_mailslot_handler *dgmslot,
return;
}
+ if (!samdb_is_pdc(samctx)) {
+ DEBUG(2, ("Not a PDC, so not processing LOGON_PRIMARY_QUERY\n"));
+ return;
+ }
+
partitions_basedn = samdb_partitions_dn(samctx, packet);
ret = gendb_search(samctx, packet, partitions_basedn, &ref_res, ref_attrs,
@@ -130,6 +136,7 @@ static void nbtd_netlogon_samlogon(struct dgram_mailslot_handler *dgmslot,
if (netlogon->req.logon.sid_size) {
if (strcasecmp(mailslot_name, NBT_MAILSLOT_NTLOGON) == 0) {
+ DEBUG(2,("NBT netlogon query failed because SID specified in request to NTLOGON\n"));
/* SID not permitted on NTLOGON (for some reason...) */
return;
}
@@ -138,13 +145,17 @@ static void nbtd_netlogon_samlogon(struct dgram_mailslot_handler *dgmslot,
sid = NULL;
}
- status = fill_netlogon_samlogon_response(samctx, packet, name->name, sid, NULL,
+ status = fill_netlogon_samlogon_response(samctx, packet, NULL, name->name, sid, NULL,
netlogon->req.logon.user_name, src->addr,
netlogon->req.logon.nt_version, iface->nbtsrv->task->lp_ctx, &netlogon_response.samlogon);
if (!NT_STATUS_IS_OK(status)) {
+ DEBUG(2,("NBT netlogon query failed domain=%s sid=%s version=%d - %s\n",
+ name->name, dom_sid_string(packet, sid), netlogon->req.logon.nt_version, nt_errstr(status)));
return;
}
+ netlogon_response.response_type = NETLOGON_SAMLOGON;
+
packet->data.msg.dest_name.type = 0;
dgram_mailslot_netlogon_reply(reply_iface->dgmsock,