summaryrefslogtreecommitdiff
path: root/source4/dsdb/common
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-08-14 19:48:32 +1000
committerAndrew Bartlett <abartlet@samba.org>2012-08-14 15:37:22 +0200
commit108c8b758ad23cd83630b2f8adf21171e815589a (patch)
tree38762f3c3f12cf35bdd23476175610d2d377cbe5 /source4/dsdb/common
parentd582e1bef6783a788378e32c64199a639d51b4e1 (diff)
downloadsamba-108c8b758ad23cd83630b2f8adf21171e815589a.tar.gz
samba-108c8b758ad23cd83630b2f8adf21171e815589a.tar.bz2
samba-108c8b758ad23cd83630b2f8adf21171e815589a.zip
s4-dsdb: Use samdb_dn_is_our_ntdsa()
This uses a GUID based comparison, and avoids re-fetching the samdb_ntds_settings_dn each time. Andrew Bartlett
Diffstat (limited to 'source4/dsdb/common')
-rw-r--r--source4/dsdb/common/util.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c
index fd8ba62aab..5d73df2ec3 100644
--- a/source4/dsdb/common/util.c
+++ b/source4/dsdb/common/util.c
@@ -1658,21 +1658,10 @@ int samdb_reference_dn_is_our_ntdsa(struct ldb_context *ldb, struct ldb_dn *base
return ret;
}
- status = dsdb_get_extended_dn_guid(referenced_dn, &referenced_guid, "GUID");
+ ret = samdb_dn_is_our_ntdsa(ldb, referenced_dn, is_ntdsa);
+
talloc_free(tmp_ctx);
- if (!NT_STATUS_IS_OK(status)) {
- return LDB_ERR_OPERATIONS_ERROR;
- }
-
-
- our_ntds_guid = samdb_ntds_objectGUID(ldb);
- if (!our_ntds_guid) {
- DEBUG(0, ("Failed to find our NTDS Settings GUID for comparison with %s on %s - %s\n", attribute, ldb_dn_get_linearized(base), ldb_errstring(ldb)));
- return LDB_ERR_OPERATIONS_ERROR;
- }
-
- *is_ntdsa = GUID_equal(&referenced_guid, our_ntds_guid);
- return LDB_SUCCESS;
+ return ret;
}
/*