summaryrefslogtreecommitdiff
path: root/source4/nbt_server/dgram
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2008-06-30 12:22:50 +1000
committerAndrew Bartlett <abartlet@samba.org>2008-06-30 12:22:50 +1000
commit6f55742b4c485258db3b8ffe36506d8623be883c (patch)
treee9ac3416cfc690aa4a341270a8a995a8fcd1ef7a /source4/nbt_server/dgram
parent71439c6283e48aaa3558b05f431f302d7e448fc5 (diff)
downloadsamba-6f55742b4c485258db3b8ffe36506d8623be883c.tar.gz
samba-6f55742b4c485258db3b8ffe36506d8623be883c.tar.bz2
samba-6f55742b4c485258db3b8ffe36506d8623be883c.zip
Rework samdb handling for 'netlogon' packets.
Don't reopen the samdb for every netlogon packet, and use the system_session(), as we must access data not available to anonymous. Perhaps we should consider a 'authenticated but not system' token, if we want more control on this. Andrew Bartlett (This used to be commit d10c9b71ea7f2670c4ea5ec569bcb7f49ec41362)
Diffstat (limited to 'source4/nbt_server/dgram')
-rw-r--r--source4/nbt_server/dgram/netlogon.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/source4/nbt_server/dgram/netlogon.c b/source4/nbt_server/dgram/netlogon.c
index 5e263a5854..5e95270b7d 100644
--- a/source4/nbt_server/dgram/netlogon.c
+++ b/source4/nbt_server/dgram/netlogon.c
@@ -56,11 +56,7 @@ static void nbtd_netlogon_getdc(struct dgram_mailslot_handler *dgmslot,
return;
}
- samctx = samdb_connect(packet, iface->nbtsrv->task->event_ctx, iface->nbtsrv->task->lp_ctx, anonymous_session(packet, iface->nbtsrv->task->event_ctx, iface->nbtsrv->task->lp_ctx));
- if (samctx == NULL) {
- DEBUG(2,("Unable to open sam in getdc reply\n"));
- return;
- }
+ samctx = iface->nbtsrv->sam_ctx;
if (!samdb_is_pdc(samctx)) {
DEBUG(2, ("Not a PDC, so not processing LOGON_PRIMARY_QUERY\n"));
@@ -126,11 +122,7 @@ static void nbtd_netlogon_samlogon(struct dgram_mailslot_handler *dgmslot,
return;
}
- samctx = samdb_connect(packet, iface->nbtsrv->task->event_ctx, iface->nbtsrv->task->lp_ctx, anonymous_session(packet, iface->nbtsrv->task->event_ctx, iface->nbtsrv->task->lp_ctx));
- if (samctx == NULL) {
- DEBUG(2,("Unable to open sam in getdc reply\n"));
- return;
- }
+ samctx = iface->nbtsrv->sam_ctx;
if (netlogon->req.logon.sid_size) {
sid = &netlogon->req.logon.sid;