mirror of
https://github.com/samba-team/samba.git
synced 2025-01-22 22:04:08 +03:00
dsdb: Use samdb_system_container_dn() in dsdb_trust_*()
This is now exactly the same actions, but just uses common code to do it. BUG: https://bugzilla.samba.org/show_bug.cgi?id=9959 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit 4250d07e4dcd43bf7450b1ae603ff46fdc892d02)
This commit is contained in:
parent
ecbba6aec2
commit
dc74e3e947
@ -2459,17 +2459,12 @@ NTSTATUS dsdb_trust_search_tdo(struct ldb_context *sam_ctx,
|
|||||||
return NT_STATUS_INVALID_PARAMETER_MIX;
|
return NT_STATUS_INVALID_PARAMETER_MIX;
|
||||||
}
|
}
|
||||||
|
|
||||||
system_dn = ldb_dn_copy(frame, ldb_get_default_basedn(sam_ctx));
|
system_dn = samdb_system_container_dn(sam_ctx, frame);
|
||||||
if (system_dn == NULL) {
|
if (system_dn == NULL) {
|
||||||
TALLOC_FREE(frame);
|
TALLOC_FREE(frame);
|
||||||
return NT_STATUS_NO_MEMORY;
|
return NT_STATUS_NO_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ldb_dn_add_child_fmt(system_dn, "CN=System")) {
|
|
||||||
TALLOC_FREE(frame);
|
|
||||||
return NT_STATUS_NO_MEMORY;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (netbios != NULL) {
|
if (netbios != NULL) {
|
||||||
netbios_encoded = ldb_binary_encode_string(frame, netbios);
|
netbios_encoded = ldb_binary_encode_string(frame, netbios);
|
||||||
if (netbios_encoded == NULL) {
|
if (netbios_encoded == NULL) {
|
||||||
@ -2617,17 +2612,12 @@ NTSTATUS dsdb_trust_search_tdo_by_sid(struct ldb_context *sam_ctx,
|
|||||||
return NT_STATUS_NO_MEMORY;
|
return NT_STATUS_NO_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
system_dn = ldb_dn_copy(frame, ldb_get_default_basedn(sam_ctx));
|
system_dn = samdb_system_container_dn(sam_ctx, frame);
|
||||||
if (system_dn == NULL) {
|
if (system_dn == NULL) {
|
||||||
TALLOC_FREE(frame);
|
TALLOC_FREE(frame);
|
||||||
return NT_STATUS_NO_MEMORY;
|
return NT_STATUS_NO_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ldb_dn_add_child_fmt(system_dn, "CN=System")) {
|
|
||||||
TALLOC_FREE(frame);
|
|
||||||
return NT_STATUS_NO_MEMORY;
|
|
||||||
}
|
|
||||||
|
|
||||||
filter = talloc_asprintf(frame,
|
filter = talloc_asprintf(frame,
|
||||||
"(&"
|
"(&"
|
||||||
"(objectClass=trustedDomain)"
|
"(objectClass=trustedDomain)"
|
||||||
@ -2794,17 +2784,12 @@ NTSTATUS dsdb_trust_search_tdos(struct ldb_context *sam_ctx,
|
|||||||
|
|
||||||
*res = NULL;
|
*res = NULL;
|
||||||
|
|
||||||
system_dn = ldb_dn_copy(frame, ldb_get_default_basedn(sam_ctx));
|
system_dn = samdb_system_container_dn(sam_ctx, frame);
|
||||||
if (system_dn == NULL) {
|
if (system_dn == NULL) {
|
||||||
TALLOC_FREE(frame);
|
TALLOC_FREE(frame);
|
||||||
return NT_STATUS_NO_MEMORY;
|
return NT_STATUS_NO_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ldb_dn_add_child_fmt(system_dn, "CN=System")) {
|
|
||||||
TALLOC_FREE(frame);
|
|
||||||
return NT_STATUS_NO_MEMORY;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (exclude != NULL) {
|
if (exclude != NULL) {
|
||||||
exclude_encoded = ldb_binary_encode_string(frame, exclude);
|
exclude_encoded = ldb_binary_encode_string(frame, exclude);
|
||||||
if (exclude_encoded == NULL) {
|
if (exclude_encoded == NULL) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user