1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

s3: cldap: cldap_multi_netlogon_send() fails with one bad IPv6 address.

Analysis by: Rebecca Gellman <rebecca@starfleet-net.co.uk>

Ignore cldap_socket_init() failure when sending
multiple cldap netlogon requests. Allow cldap_netlogon_send()
to catch the bad address and correctly return through a
tevent subreq.

Make sure cldap_search_send() copes with cldap parameter == NULL.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12381

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Oct 18 02:16:20 CEST 2016 on sn-devel-144
This commit is contained in:
Jeremy Allison 2016-10-17 10:07:23 -07:00 committed by Ralph Boehme
parent e84521dc44
commit 44a7040500
2 changed files with 20 additions and 2 deletions

View File

@ -585,6 +585,11 @@ struct tevent_req *cldap_search_send(TALLOC_CTX *mem_ctx,
talloc_set_destructor(state, cldap_search_state_destructor);
if (state->caller.cldap == NULL) {
tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);
goto post;
}
if (io->in.dest_address) {
if (cldap->connected) {
tevent_req_nterror(req, NT_STATUS_PIPE_CONNECTED);

View File

@ -117,8 +117,21 @@ struct tevent_req *cldap_multi_netlogon_send(
NULL, /* local_addr */
state->servers[i],
&state->cldap[i]);
if (tevent_req_nterror(req, status)) {
return tevent_req_post(req, ev);
if (!NT_STATUS_IS_OK(status)) {
/*
* Don't error out all sends just
* because one cldap_socket_init() failed.
* Log it here, and the cldap_netlogon_send()
* will catch it (with in.dest_address == NULL)
* and correctly error out in
* cldap_multi_netlogon_done(). This still allows
* the other requests to be concurrently sent.
*/
DBG_NOTICE("cldap_socket_init failed for %s "
" error %s\n",
tsocket_address_string(state->servers[i],
req),
nt_errstr(status));
}
state->ios[i].in.dest_address = NULL;