diff options
author | Jeremy Allison <jra@samba.org> | 2002-10-17 17:10:29 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2002-10-17 17:10:29 +0000 |
commit | 389a16d9d5331ddc7ae61d3d4ef3a4ee48734d4b (patch) | |
tree | c1befae62be9d225a39f3a32c814f9ab27853bf9 /source3/nsswitch | |
parent | 8cb53d56f21f5a33d7dc55e7bd7cd559a112ac52 (diff) | |
download | samba-389a16d9d5331ddc7ae61d3d4ef3a4ee48734d4b.tar.gz samba-389a16d9d5331ddc7ae61d3d4ef3a4ee48734d4b.tar.bz2 samba-389a16d9d5331ddc7ae61d3d4ef3a4ee48734d4b.zip |
Added new error codes. Fix up connection code to retry in the same way
that app-head does.
Jeremy.
(This used to be commit b521abd86b10573ca8f9116907c81e6deb55f049)
Diffstat (limited to 'source3/nsswitch')
-rw-r--r-- | source3/nsswitch/winbindd_cm.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/source3/nsswitch/winbindd_cm.c b/source3/nsswitch/winbindd_cm.c index cb1779f590..5f477c78f7 100644 --- a/source3/nsswitch/winbindd_cm.c +++ b/source3/nsswitch/winbindd_cm.c @@ -392,6 +392,8 @@ static NTSTATUS cm_open_connection(const char *domain, const int pipe_index, NTSTATUS result; char *ipc_username, *ipc_domain, *ipc_password; struct in_addr dc_ip; + int i; + BOOL retry = True; ZERO_STRUCT(dc_ip); @@ -446,10 +448,22 @@ static NTSTATUS cm_open_connection(const char *domain, const int pipe_index, DEBUG(5, ("connecting to %s from %s with username [%s]\\[%s]\n", new_conn->controller, global_myname, ipc_domain, ipc_username)); - result = cli_full_connection(&(new_conn->cli), global_myname, new_conn->controller, - &dc_ip, 0, "IPC$", - "IPC", ipc_username, ipc_domain, - ipc_password, 0); + for (i = 0; retry && (i < 3); i++) { + + if (!secrets_named_mutex(new_conn->controller, 10)) { + DEBUG(0,("cm_open_connection: mutex grab failed for %s\n", new_conn->controller)); + continue; + } + + result = cli_full_connection(&(new_conn->cli), global_myname, new_conn->controller, + &dc_ip, 0, "IPC$", "IPC", ipc_username, ipc_domain, + ipc_password, 0, &retry); + + secrets_named_mutex_release(new_conn->controller); + + if (NT_STATUS_IS_OK(result)) + break; + } SAFE_FREE(ipc_username); SAFE_FREE(ipc_domain); |