diff options
author | Gerald (Jerry) Carter <jerry@samba.org> | 2008-08-22 10:17:04 -0500 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2008-08-22 23:31:58 +0200 |
commit | 9bbd6ee5db03747499bd263bb1365c8cd352076d (patch) | |
tree | 278248703f0d087b07739e0f654616afc5cad1e3 | |
parent | b3a8b823361d6144f14c2d800e956f26ff9ad6d6 (diff) | |
download | samba-9bbd6ee5db03747499bd263bb1365c8cd352076d.tar.gz |
winbindd: Fix crash in cm_connect_sam()
Fix segv when talking to parent DC (joined to child domain).
The root cause was
(a) storing the parent domain in the cli_state struct caused
the NTLMSSP pipe bind to fail which made us fallover to
the schannel code path
(b) the dcinfo pointer in cm_get_schannel_dcinfo() was returning
NULL even though the function indicated success.
(cherry picked from commit 5ce4a2ae6697970ea37d0078a506615b4b7a9a9c)
(cherry picked from commit 72d138adc200ab36e324721900af1a06d0879318)
-rw-r--r-- | source/winbindd/winbindd_cm.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/winbindd/winbindd_cm.c b/source/winbindd/winbindd_cm.c index c9769bfdca8..ab8287a01a1 100644 --- a/source/winbindd/winbindd_cm.c +++ b/source/winbindd/winbindd_cm.c @@ -846,7 +846,7 @@ static NTSTATUS cm_prepare_connection(const struct winbindd_domain *domain, result = ads_ntstatus(ads_status); if (NT_STATUS_IS_OK(result)) { /* Ensure creds are stored for NTLMSSP authenticated pipe access. */ - cli_init_creds(*cli, machine_account, domain->name, machine_password); + cli_init_creds(*cli, machine_account, lp_workgroup(), machine_password); goto session_setup_done; } } @@ -871,7 +871,7 @@ static NTSTATUS cm_prepare_connection(const struct winbindd_domain *domain, result = ads_ntstatus(ads_status); if (NT_STATUS_IS_OK(result)) { /* Ensure creds are stored for NTLMSSP authenticated pipe access. */ - cli_init_creds(*cli, machine_account, domain->name, machine_password); + cli_init_creds(*cli, machine_account, lp_workgroup(), machine_password); goto session_setup_done; } } @@ -1900,6 +1900,10 @@ static bool cm_get_schannel_dcinfo(struct winbindd_domain *domain, /* Return a pointer to the struct dcinfo from the netlogon pipe. */ + if (!domain->conn.netlogon_pipe->dc) { + return false; + } + *ppdc = domain->conn.netlogon_pipe->dc; return True; } @@ -1926,6 +1930,7 @@ NTSTATUS cm_connect_sam(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx, goto done; } + /* * No SAMR pipe yet. Attempt to get an NTLMSSP SPNEGO authenticated * sign and sealed pipe using the machine account password by |