1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

Use the correct domain name when looking up the trust password.

On a DC, we always use the domain name given.  On a domain member,
we use lp_workgroup().  This fixes a bug supporting trusted domains.
This commit is contained in:
Gerald W. Carter 2008-01-25 12:18:05 -06:00
parent 95e0fb452b
commit 8b063a4141

View File

@ -679,8 +679,22 @@ static NTSTATUS get_trust_creds(const struct winbindd_domain *domain,
char **machine_krb5_principal)
{
const char *account_name;
const char *name = NULL;
/* If we are a DC and this is not our own domain */
if (!get_trust_pw_clear(domain->name, machine_password,
if (IS_DC) {
name = domain->name;
} else {
struct winbindd_domain *our_domain = find_our_domain();
if (!our_domain)
return NT_STATUS_INVALID_SERVER_STATE;
name = our_domain->name;
}
if (!get_trust_pw_clear(name, machine_password,
&account_name, NULL))
{
return NT_STATUS_CANT_ACCESS_DOMAIN_INFO;