summaryrefslogtreecommitdiff
path: root/source4/dsdb/common
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2009-12-04 10:15:15 +1100
committerAndrew Bartlett <abartlet@samba.org>2009-12-07 13:07:03 +1100
commit45cd4c93fbcabe8e5c66f57f8ded08a860af1bce (patch)
tree4ba5c3becfea871f7251dc800ebd8b14235f3926 /source4/dsdb/common
parenta4725f5880a3cebca83f0e0091403a4b80100e38 (diff)
downloadsamba-45cd4c93fbcabe8e5c66f57f8ded08a860af1bce.tar.gz
samba-45cd4c93fbcabe8e5c66f57f8ded08a860af1bce.tar.bz2
samba-45cd4c93fbcabe8e5c66f57f8ded08a860af1bce.zip
s4:dsdb Make parentGUID handler use dsdb_module_search_dn()
This avoids doing a new search from the top of the module stack. This also removes the helper function dsdb_find_parentguid_by_dn() which is now unused. Andrew Bartlett
Diffstat (limited to 'source4/dsdb/common')
-rw-r--r--source4/dsdb/common/util.c58
1 files changed, 0 insertions, 58 deletions
diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c
index 8c9c98201b..d9e03cec3e 100644
--- a/source4/dsdb/common/util.c
+++ b/source4/dsdb/common/util.c
@@ -2286,64 +2286,6 @@ int dsdb_find_guid_by_dn(struct ldb_context *ldb,
}
-/*
- Use a DN to find it's parentGUID
-
- Results
- LDB_ERR_OPERATIONS_ERROR for out of memory
- LDB_ERR_NO_SUCH_OBJECT if there is no parent object for the given DN
- LDB_ERR_NO_SUCH_ATTRIBUTE if couldn't get the ObjectGUID from the parent
- LDB_SUCCESS if it could find the parentGUID correctly
- */
-int dsdb_find_parentguid_by_dn(struct ldb_context *ldb,
- struct ldb_dn *dn,
- struct GUID *parent_guid)
-{
-
- int ret;
- struct ldb_result *res;
- struct ldb_dn *parent_dn;
- const char *attrs[] = { "objectGUID", NULL };
- TALLOC_CTX *tmp_ctx = talloc_new(ldb);
-
-
- parent_dn = ldb_dn_get_parent(tmp_ctx, dn);
-
- if (parent_dn == NULL){
- DEBUG(4,(__location__ ": Failed to find parent for dn %s\n",
- ldb_dn_get_linearized(dn)));
- ret = LDB_ERR_NO_SUCH_OBJECT;
- goto done;
- }
-
- /*
- The few lines of code bellow are very similar to the
- dsdb_find_guid_by_dn() function implementation, but this way we can
- differ situations when the parent_dn doesn't exist from when there is
- an error on returning it's GUID.
- */
- ret = dsdb_search_dn_with_deleted(ldb, tmp_ctx, &res, parent_dn, attrs);
- if (ret != LDB_SUCCESS) {
- DEBUG(4,(__location__ ": Parent dn for %s does not exist \n",
- ldb_dn_get_linearized(dn)));
- /* When there is no parent dn, it simply doesn't return a parentGUID */
- ret = LDB_ERR_NO_SUCH_OBJECT;
- goto done;
- }
- if (res->count < 1) {
- DEBUG(4,(__location__ ": Failed to find GUID for dn %s\n",
- ldb_dn_get_linearized(parent_dn)));
- ret = LDB_ERR_NO_SUCH_ATTRIBUTE;
- goto done;
- }
-
- *parent_guid = samdb_result_guid(res->msgs[0], "objectGUID");
- ret = LDB_SUCCESS;
-
-done:
- talloc_free(tmp_ctx);
- return ret;
-}
/*
adds the given GUID to the given ldb_message. This value is added