h = talloc_zero(req, struct ldb_handle);
if (h == NULL) {
- ldb_set_errstring(module->ldb, talloc_asprintf(module, "Out of Memory"));
+ ldb_set_errstring(module->ldb, "Out of Memory");
return NULL;
}
ac = talloc_zero(h, struct lpdb_context);
if (ac == NULL) {
- ldb_set_errstring(module->ldb, talloc_asprintf(module, "Out of Memory"));
+ ldb_set_errstring(module->ldb, "Out of Memory");
talloc_free(h);
return NULL;
}
/* TODO: remove this when sambaPassword will be in schema */
if (!ldb_msg_check_string_attribute(req->op.add.message, "objectClass", "person")) {
- ldb_set_errstring(module->ldb, talloc_asprintf(module, "Cannot relocate a password on entry: %s, does not have objectClass 'person'",
- ldb_dn_linearize(req, req->op.add.message->dn)));
+ ldb_asprintf_errstring(module->ldb,
+ "Cannot relocate a password on entry: %s, does not have objectClass 'person'",
+ ldb_dn_linearize(req, req->op.add.message->dn));
return LDB_ERR_OBJECT_CLASS_VIOLATION;
}
* search', to allow the directory to create the objectGUID */
if (ldb_msg_find_ldb_val(ac->orig_req->op.add.message, "objectGUID") == NULL) {
ldb_set_errstring(module->ldb,
- talloc_asprintf(req,
- "no objectGUID found in search: local_password module must be configured below objectGUID module!\n"));
+ "no objectGUID found in search: local_password module must be configured below objectGUID module!\n");
return LDB_ERR_CONSTRAINT_VIOLATION;
}
struct lpdb_context *ac;
if (!context || !ares) {
- ldb_set_errstring(ldb, talloc_asprintf(ldb, "NULL Context or Result in callback"));
+ ldb_set_errstring(ldb, "NULL Context or Result in callback");
return LDB_ERR_OPERATIONS_ERROR;
}
/* we are interested only in the single reply (base search) we receive here */
if (ares->type == LDB_REPLY_ENTRY) {
if (ac->search_res != NULL) {
- ldb_set_errstring(ldb, talloc_asprintf(ldb, "Too many results"));
+ ldb_set_errstring(ldb, "Too many results");
talloc_free(ares);
return LDB_ERR_OPERATIONS_ERROR;
}
ac->search_req->op.search.scope = LDB_SCOPE_BASE;
ac->search_req->op.search.tree = ldb_parse_tree(ac->module->ldb, NULL);
if (ac->search_req->op.search.tree == NULL) {
- ldb_set_errstring(ac->module->ldb, talloc_asprintf(ac, "Invalid search filter"));
+ ldb_set_errstring(ac->module->ldb, "Invalid search filter");
return LDB_ERR_OPERATIONS_ERROR;
}
ac->search_req->op.search.attrs = attrs;
/* if it is not an entry of type person this is an error */
/* TODO: remove this when sambaPassword will be in schema */
if (!ac->search_res) {
- ldb_set_errstring(ac->module->ldb,
- talloc_asprintf(ac,
- "entry just modified (%s) not found!",
- ldb_dn_linearize(ac, ac->remote_req->op.mod.message->dn)));
+ ldb_asprintf_errstring(ac->module->ldb,
+ "entry just modified (%s) not found!",
+ ldb_dn_linearize(ac, ac->remote_req->op.mod.message->dn));
return LDB_ERR_OPERATIONS_ERROR;
}
if (!ldb_msg_check_string_attribute(ac->search_res->message, "objectClass", "person")) {
if (ldb_msg_find_ldb_val(ac->search_res->message, "objectGUID") == NULL) {
ldb_set_errstring(ac->module->ldb,
- talloc_asprintf(ac,
- "no objectGUID found in search: local_password module must be configured below objectGUID module!\n"));
+ "no objectGUID found in search: local_password module must be configured below objectGUID module!\n");
return LDB_ERR_OBJECT_CLASS_VIOLATION;
}
struct lpdb_local_search_context *local_context;
if (!context || !ares) {
- ldb_set_errstring(ldb, talloc_asprintf(ldb, "NULL Context or Result in callback"));
+ ldb_set_errstring(ldb, "NULL Context or Result in callback");
return LDB_ERR_OPERATIONS_ERROR;
}
{
int i;
if (local_context->local_res != NULL) {
- ldb_set_errstring(ldb, talloc_asprintf(ldb, "Too many results to base search for password entry!"));
+ ldb_set_errstring(ldb, "Too many results to base search for password entry!");
talloc_free(ares);
return LDB_ERR_OPERATIONS_ERROR;
}
default:
{
talloc_free(ares);
- ldb_set_errstring(ldb, talloc_asprintf(ldb, "Unexpected result type in base search for password entry!"));
+ ldb_set_errstring(ldb, "Unexpected result type in base search for password entry!");
return LDB_ERR_OPERATIONS_ERROR;
}
}
struct lpdb_context *ac;
if (!context || !ares) {
- ldb_set_errstring(ldb, talloc_asprintf(ldb, "NULL Context or Result in callback"));
+ ldb_set_errstring(ldb, "NULL Context or Result in callback");
goto error;
}
if (ldb_msg_find_ldb_val(ares->message, "objectGUID") == NULL) {
ldb_set_errstring(ac->module->ldb,
- talloc_asprintf(ac,
- "no objectGUID found in search: local_password module must be configured below objectGUID module!\n"));
+ "no objectGUID found in search: local_password module must be configured below objectGUID module!\n");
return LDB_ERR_OPERATIONS_ERROR;
}
req->op.search.scope = LDB_SCOPE_BASE;
req->op.search.tree = ldb_parse_tree(ac->module->ldb, NULL);
if (req->op.search.tree == NULL) {
- ldb_set_errstring(ac->module->ldb, talloc_asprintf(ac, "out of memory"));
+ ldb_set_errstring(ac->module->ldb, "Out of Memory");
return LDB_ERR_OPERATIONS_ERROR;
}
req->op.search.attrs = ac->orig_req->op.search.attrs;