From 462402fc098a8d727d92dee8114a3b06d96e3c93 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 19 Mar 2002 06:36:37 +0000 Subject: Fix a double-free bug in wbinfo -t's call in winbindd. I forgot to clean this up when netlogon move across to the connection cache arrangement. Also add some smb_panics to the connection_ok() code to try to catch this kind of thing better in future. Andrew Bartlett (This used to be commit f4f23fad6099143ec26550afc67655390070ceb8) --- source3/nsswitch/winbindd_cm.c | 6 ++++-- source3/nsswitch/winbindd_misc.c | 9 ++++----- 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'source3/nsswitch') diff --git a/source3/nsswitch/winbindd_cm.c b/source3/nsswitch/winbindd_cm.c index dfae06ff00..03a8e3cdd1 100644 --- a/source3/nsswitch/winbindd_cm.c +++ b/source3/nsswitch/winbindd_cm.c @@ -379,14 +379,16 @@ static BOOL connection_ok(struct winbindd_cm_conn *conn) } if (!conn->cli) { - DEBUG(3, ("Connection to %s for domain %s (pipe %s) has NULL conn->cli!\n", + DEBUG(0, ("Connection to %s for domain %s (pipe %s) has NULL conn->cli!\n", conn->controller, conn->domain, conn->pipe_name)); + smb_panic("connection_ok: conn->cli was null!"); return False; } if (!conn->cli->initialised) { - DEBUG(3, ("Connection to %s for domain %s (pipe %s) was never initialised!\n", + DEBUG(0, ("Connection to %s for domain %s (pipe %s) was never initialised!\n", conn->controller, conn->domain, conn->pipe_name)); + smb_panic("connection_ok: conn->cli->initialised is False!"); return False; } diff --git a/source3/nsswitch/winbindd_misc.c b/source3/nsswitch/winbindd_misc.c index 81adcc373e..5678bdaa5a 100644 --- a/source3/nsswitch/winbindd_misc.c +++ b/source3/nsswitch/winbindd_misc.c @@ -60,6 +60,7 @@ enum winbindd_result winbindd_check_machine_acct(struct winbindd_cli_state *stat /* This call does a cli_nt_setup_creds() which implicitly checks the trust account password. */ + /* Don't shut this down - it belongs to the connection cache code */ result = cm_get_netlogon_cli(lp_workgroup(), trust_passwd, &cli); if (!NT_STATUS_IS_OK(result)) { @@ -67,12 +68,10 @@ enum winbindd_result winbindd_check_machine_acct(struct winbindd_cli_state *stat goto done; } - cli_shutdown(cli); - /* There is a race condition between fetching the trust account - password and joining the domain so it's possible that the trust - account password has been changed on us. We are returned - NT_STATUS_ACCESS_DENIED if this happens. */ + password and the periodic machine password change. So it's + possible that the trust account password has been changed on us. + We are returned NT_STATUS_ACCESS_DENIED if this happens. */ #define MAX_RETRIES 8 -- cgit