mirror of
https://github.com/samba-team/samba.git
synced 2025-02-26 21:57:41 +03:00
s3:pdb_samba_dsdb: make use of dsdb_trust_search_tdo()
dsdb_trust_search_tdo() is almost the same as sam_get_results_trust(), so we can remove sam_get_results_trust() later. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
parent
839645d238
commit
347d54047f
@ -2157,15 +2157,16 @@ static bool pdb_samba_dsdb_get_trusteddom_pw(struct pdb_methods *m,
|
||||
const char *netbios_domain = NULL;
|
||||
const struct dom_sid *domain_sid = NULL;
|
||||
|
||||
status = sam_get_results_trust(state->ldb, tmp_ctx, domain,
|
||||
NULL, attrs, &msg);
|
||||
status = dsdb_trust_search_tdo(state->ldb, domain, NULL,
|
||||
attrs, tmp_ctx, &msg);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
/*
|
||||
* This can be called to work out of a domain is
|
||||
* trusted, rather than just to get the password
|
||||
*/
|
||||
DEBUG(2, ("Failed to get trusted domain password for %s. "
|
||||
"It may not be a trusted domain.\n", domain));
|
||||
DEBUG(2, ("Failed to get trusted domain password for %s - %s. "
|
||||
"It may not be a trusted domain.\n", domain,
|
||||
nt_errstr(status)));
|
||||
TALLOC_FREE(tmp_ctx);
|
||||
return false;
|
||||
}
|
||||
@ -2317,17 +2318,18 @@ static NTSTATUS pdb_samba_dsdb_get_trusteddom_creds(struct pdb_methods *m,
|
||||
char *principal_name = NULL;
|
||||
const char *dns_domain = NULL;
|
||||
|
||||
status = sam_get_results_trust(state->ldb, tmp_ctx, domain,
|
||||
NULL, attrs, &msg);
|
||||
status = dsdb_trust_search_tdo(state->ldb, domain, NULL,
|
||||
attrs, tmp_ctx, &msg);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
/*
|
||||
* This can be called to work out of a domain is
|
||||
* trusted, rather than just to get the password
|
||||
*/
|
||||
DEBUG(2, ("Failed to get trusted domain password for %s. "
|
||||
"It may not be a trusted domain.\n", domain));
|
||||
DEBUG(2, ("Failed to get trusted domain password for %s - %s "
|
||||
"It may not be a trusted domain.\n", domain,
|
||||
nt_errstr(status)));
|
||||
TALLOC_FREE(tmp_ctx);
|
||||
return status;
|
||||
return NT_STATUS_CANT_ACCESS_DOMAIN_INFO;
|
||||
}
|
||||
|
||||
netbios_domain = ldb_msg_find_attr_as_string(msg, "flatName", NULL);
|
||||
@ -2612,15 +2614,16 @@ static bool pdb_samba_dsdb_set_trusteddom_pw(struct pdb_methods *m,
|
||||
return false;
|
||||
}
|
||||
|
||||
status = sam_get_results_trust(state->ldb, tmp_ctx, domain,
|
||||
NULL, attrs, &msg);
|
||||
status = dsdb_trust_search_tdo(state->ldb, domain, NULL,
|
||||
attrs, tmp_ctx, &msg);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
/*
|
||||
* This can be called to work out of a domain is
|
||||
* trusted, rather than just to get the password
|
||||
*/
|
||||
DEBUG(2, ("Failed to get trusted domain password for %s. "
|
||||
"It may not be a trusted domain.\n", domain));
|
||||
DEBUG(2, ("Failed to get trusted domain password for %s - %s. "
|
||||
"It may not be a trusted domain.\n", domain,
|
||||
nt_errstr(status)));
|
||||
TALLOC_FREE(tmp_ctx);
|
||||
ldb_transaction_cancel(state->ldb);
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user