summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules/local_password.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-07-06 13:21:54 +1000
committerAndrew Tridgell <tridge@samba.org>2010-07-07 20:14:55 +1000
commit87df785a68c1c8043b345b71c98764ef36b76179 (patch)
treea4d3071a393661c93e97f9963e492d494241173c /source4/dsdb/samdb/ldb_modules/local_password.c
parentfc68558ab937859a91214e8675d53c0afaf3c4e6 (diff)
downloadsamba-87df785a68c1c8043b345b71c98764ef36b76179.tar.gz
samba-87df785a68c1c8043b345b71c98764ef36b76179.tar.bz2
samba-87df785a68c1c8043b345b71c98764ef36b76179.zip
s4-dsdb: use ldb_operr() in the dsdb code
this replaces "return LDB_ERR_OPERATIONS_ERROR" with "return ldb_operr(ldb)" in places in the dsdb code where we don't already explicitly set an error string. This should make is much easier to track down dsdb module bugs that result in an operations error.
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules/local_password.c')
-rw-r--r--source4/dsdb/samdb/ldb_modules/local_password.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/local_password.c b/source4/dsdb/samdb/ldb_modules/local_password.c
index 4f9cfd63d4..942b5a2543 100644
--- a/source4/dsdb/samdb/ldb_modules/local_password.c
+++ b/source4/dsdb/samdb/ldb_modules/local_password.c
@@ -187,12 +187,12 @@ static int local_password_add(struct ldb_module *module, struct ldb_request *req
/* From here, we assume we have password attributes to split off */
ac = lpdb_init_context(module, req);
if (!ac) {
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_operr(ldb);
}
remote_message = ldb_msg_copy_shallow(remote_req, req->op.add.message);
if (remote_message == NULL) {
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_operr(ldb);
}
/* Remove any password attributes from the remote message */
@@ -205,7 +205,7 @@ static int local_password_add(struct ldb_module *module, struct ldb_request *req
ac->local_message = ldb_msg_copy_shallow(ac, req->op.add.message);
if (ac->local_message == NULL) {
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_operr(ldb);
}
/* Remove anything seen in the remote message from the local
@@ -232,7 +232,7 @@ static int local_password_add(struct ldb_module *module, struct ldb_request *req
PASSWORD_GUID_ATTR "=%s",
GUID_string(ac->local_message,
&objectGUID)))) {
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_operr(ldb);
}
ret = ldb_build_add_req(&remote_req, ldb, ac,
@@ -339,12 +339,12 @@ static int local_password_modify(struct ldb_module *module, struct ldb_request *
/* From here, we assume we have password attributes to split off */
ac = lpdb_init_context(module, req);
if (!ac) {
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_operr(ldb);
}
remote_message = ldb_msg_copy_shallow(ac, ac->req->op.mod.message);
if (remote_message == NULL) {
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_operr(ldb);
}
/* Remove any password attributes from the remote message */
@@ -354,7 +354,7 @@ static int local_password_modify(struct ldb_module *module, struct ldb_request *
ac->local_message = ldb_msg_copy_shallow(ac, ac->req->op.mod.message);
if (ac->local_message == NULL) {
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_operr(ldb);
}
/* Remove anything seen in the remote message from the local
@@ -571,7 +571,7 @@ static int local_password_delete(struct ldb_module *module,
/* From here, we assume we have password attributes to split off */
ac = lpdb_init_context(module, req);
if (!ac) {
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_operr(ldb);
}
ret = ldb_build_del_req(&remote_req, ldb, ac,
@@ -769,7 +769,7 @@ static int lpdb_local_search(struct lpdb_context *ac)
ac, lpdb_local_search_callback,
ac->req);
if (ret != LDB_SUCCESS) {
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_operr(ldb);
}
return ldb_next_request(ac->module, local_req);
@@ -1046,7 +1046,7 @@ static int local_password_search(struct ldb_module *module, struct ldb_request *
ac = lpdb_init_context(module, req);
if (!ac) {
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_operr(ldb);
}
/* Remote search is for all attributes: if the remote LDAP server has these attributes, then it overrides the local database */
@@ -1055,7 +1055,7 @@ static int local_password_search(struct ldb_module *module, struct ldb_request *
search_attrs = ldb_attr_list_copy_add(ac, req->op.search.attrs, "objectGUID");
ac->added_objectGUID = true;
if (!search_attrs) {
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_operr(ldb);
}
} else {
search_attrs = req->op.search.attrs;
@@ -1064,7 +1064,7 @@ static int local_password_search(struct ldb_module *module, struct ldb_request *
search_attrs = ldb_attr_list_copy_add(ac, search_attrs, "objectClass");
ac->added_objectClass = true;
if (!search_attrs) {
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_operr(ldb);
}
}
} else {