summaryrefslogtreecommitdiff
path: root/source4/dsdb
diff options
context:
space:
mode:
authorKamen Mazdrashki <kamenim@samba.org>2011-02-15 16:09:37 +0200
committerKamen Mazdrashki <kamenim@samba.org>2011-02-15 16:55:32 +0100
commitaaae3164b5220f42b5524cb030ebfd17e88bd32e (patch)
treebc21668ee42bc8ba8701c49c7f0700f4c9b8cd55 /source4/dsdb
parentfa36577ae125a9043edcc896333d97b21280489d (diff)
downloadsamba-aaae3164b5220f42b5524cb030ebfd17e88bd32e.tar.gz
samba-aaae3164b5220f42b5524cb030ebfd17e88bd32e.tar.bz2
samba-aaae3164b5220f42b5524cb030ebfd17e88bd32e.zip
s4-ldb_modules/operational: Make use of dsdb_module_reference_dn() function
it does exactly what we need here Autobuild-User: Kamen Mazdrashki <kamenim@samba.org> Autobuild-Date: Tue Feb 15 16:55:32 CET 2011 on sn-devel-104
Diffstat (limited to 'source4/dsdb')
-rw-r--r--source4/dsdb/samdb/ldb_modules/operational.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/operational.c b/source4/dsdb/samdb/ldb_modules/operational.c
index 1df56e8fe0..3f2977df32 100644
--- a/source4/dsdb/samdb/ldb_modules/operational.c
+++ b/source4/dsdb/samdb/ldb_modules/operational.c
@@ -438,15 +438,13 @@ static int construct_msds_isrodc_with_computer_dn(struct ldb_module *module,
struct ldb_message *msg,
struct ldb_request *parent)
{
- struct ldb_context *ldb;
- const char *attr[] = { "serverReferenceBL", NULL };
- struct ldb_result *res;
int ret;
struct ldb_dn *server_dn;
- ret = dsdb_module_search_dn(module, msg, &res, msg->dn, attr,
- DSDB_FLAG_NEXT_MODULE, parent);
- if (ret == LDB_ERR_NO_SUCH_OBJECT) {
+ ret = dsdb_module_reference_dn(module, msg, msg->dn, "serverReferenceBL",
+ &server_dn, parent);
+ if (ret == LDB_ERR_NO_SUCH_OBJECT || ret == LDB_ERR_NO_SUCH_ATTRIBUTE) {
+ /* it's OK if we can't find serverReferenceBL attribute */
DEBUG(4,(__location__ ": Can't get serverReferenceBL for %s \n",
ldb_dn_get_linearized(msg->dn)));
return LDB_SUCCESS;
@@ -454,17 +452,6 @@ static int construct_msds_isrodc_with_computer_dn(struct ldb_module *module,
return ret;
}
- ldb = ldb_module_get_ctx(module);
- if (!ldb) {
- return LDB_SUCCESS;
- }
-
- server_dn = ldb_msg_find_attr_as_dn(ldb, msg, res->msgs[0], "serverReferenceBL");
- if (!server_dn) {
- DEBUG(4,(__location__ ": Can't find serverReferenceBL for %s \n",
- ldb_dn_get_linearized(res->msgs[0]->dn)));
- return LDB_SUCCESS;
- }
return construct_msds_isrodc_with_server_dn(module, msg, server_dn, parent);
}