summaryrefslogtreecommitdiff
path: root/source3/nsswitch
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2005-08-28 09:19:10 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:03:24 -0500
commit86dc60492aa0c4c42b7506aa6ac6f4ac5e27c9f6 (patch)
tree9f742cb47dcddfb6f0cd1f2aa4091dbc720b79b0 /source3/nsswitch
parentf44e11c100751f2202be9052503bd891c626e6ed (diff)
downloadsamba-86dc60492aa0c4c42b7506aa6ac6f4ac5e27c9f6.tar.gz
samba-86dc60492aa0c4c42b7506aa6ac6f4ac5e27c9f6.tar.bz2
samba-86dc60492aa0c4c42b7506aa6ac6f4ac5e27c9f6.zip
r9709: Fix two bugs found by Brian Moran: Any request sent to winbind while the child
in question is still initializing overwrites domain->dcname. Only overwrite if the parent actually has sent a dcname and thus really knows it. Second, ntlm_auth needs the error code, not just the fact it failed. Jerry, the 3_0 part might qualify as a "recommended patch". Thanks, Volker (This used to be commit d79b179b7f9d2efa4f8ee47bfe386e90d8b58322)
Diffstat (limited to 'source3/nsswitch')
-rw-r--r--source3/nsswitch/winbindd_dual.c10
-rw-r--r--source3/nsswitch/winbindd_util.c4
2 files changed, 7 insertions, 7 deletions
diff --git a/source3/nsswitch/winbindd_dual.c b/source3/nsswitch/winbindd_dual.c
index 940cd12ba5..ec0b7a36e2 100644
--- a/source3/nsswitch/winbindd_dual.c
+++ b/source3/nsswitch/winbindd_dual.c
@@ -158,9 +158,8 @@ static void async_reply_recv(void *private_data, BOOL success)
return;
}
- if (state->response->result == WINBINDD_OK)
- SMB_ASSERT(cache_retrieve_response(child->pid,
- state->response));
+ SMB_ASSERT(cache_retrieve_response(child->pid,
+ state->response));
DLIST_REMOVE(child->requests, state);
@@ -479,12 +478,11 @@ static BOOL fork_domain_child(struct winbindd_child *child)
DEBUG(4,("child daemon request %d\n",
(int)state.request.cmd));
+ ZERO_STRUCT(state.response);
state.request.null_term = '\0';
child_process_request(child->domain, &state);
- if (state.response.result == WINBINDD_OK)
- cache_store_response(sys_getpid(),
- &state.response);
+ cache_store_response(sys_getpid(), &state.response);
SAFE_FREE(state.response.extra_data);
diff --git a/source3/nsswitch/winbindd_util.c b/source3/nsswitch/winbindd_util.c
index 2be1520250..6b1a6b5b4d 100644
--- a/source3/nsswitch/winbindd_util.c
+++ b/source3/nsswitch/winbindd_util.c
@@ -444,7 +444,9 @@ enum winbindd_result winbindd_dual_init_connection(struct winbindd_domain *domai
state->request.data.init_conn.dcname
[sizeof(state->request.data.init_conn.dcname)-1]='\0';
- fstrcpy(domain->dcname, state->request.data.init_conn.dcname);
+ if (strlen(state->request.data.init_conn.dcname) > 0) {
+ fstrcpy(domain->dcname, state->request.data.init_conn.dcname);
+ }
if (strlen(domain->dcname) > 0) {
if (!resolve_name(domain->dcname, &ipaddr, 0x20)) {