summaryrefslogtreecommitdiff
path: root/source3/winbindd/winbindd_cm.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2010-11-13 20:32:36 -0800
committerJeremy Allison <jra@samba.org>2010-11-14 05:22:45 +0000
commit52f252064817b4be4d45d9fdbb0ad07748a0f317 (patch)
treecebc18dd44724ff5ff1e03da4a3736f89ec32f06 /source3/winbindd/winbindd_cm.c
parent781c4aabb87e63df77c76a360b6ed5f6a20e6d58 (diff)
downloadsamba-52f252064817b4be4d45d9fdbb0ad07748a0f317.tar.gz
samba-52f252064817b4be4d45d9fdbb0ad07748a0f317.tar.bz2
samba-52f252064817b4be4d45d9fdbb0ad07748a0f317.zip
Fix the unexpected.tdb database problem. Change nmbd to store the
transaction id of packets it was requested to send via a client, and only store replies that match these ids. On the client side change clients to always attempt to ask nmbd first for name_query and node_status calls, and then fall back to doing socket calls if we can't talk to nmbd (either nmbd is not running, or we're not root and cannot open the messaging tdb's). Fix readers of unexpected.tdb to delete packets they've successfully read. This should fix a long standing problem of unexpected.tdb growing out of control in noisy NetBIOS envioronments with lots of bradcasts, yet still allow unprivileged client apps to work mostly as well as they already did (nmblookup for example) in an environment when nmbd isn't running. Jeremy. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Sun Nov 14 05:22:45 UTC 2010 on sn-devel-104
Diffstat (limited to 'source3/winbindd/winbindd_cm.c')
-rw-r--r--source3/winbindd/winbindd_cm.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
index 9de15b08cf..8f641b56d7 100644
--- a/source3/winbindd/winbindd_cm.c
+++ b/source3/winbindd/winbindd_cm.c
@@ -1122,6 +1122,8 @@ static bool dcip_to_name(TALLOC_CTX *mem_ctx,
{
struct ip_service ip_list;
uint32_t nt_version = NETLOGON_NT_VERSION_1;
+ int dgm_id;
+ uint16_t val;
ip_list.ss = *pss;
ip_list.port = 0;
@@ -1187,15 +1189,18 @@ static bool dcip_to_name(TALLOC_CTX *mem_ctx,
#endif
/* try GETDC requests next */
+ generate_random_buffer((uint8_t *)&val, 2);
+ dgm_id = val;
if (send_getdc_request(mem_ctx, winbind_messaging_context(),
pss, domain->name, &domain->sid,
- nt_version)) {
+ nt_version, dgm_id)) {
const char *dc_name = NULL;
int i;
smb_msleep(100);
for (i=0; i<5; i++) {
if (receive_getdc_response(mem_ctx, pss, domain->name,
+ dgm_id,
&nt_version,
&dc_name, NULL)) {
fstrcpy(name, dc_name);