free(sam_ctx);
}
-/*
- a alloc function for ldb
-*/
-static void *samdb_alloc(void *context, void *ptr, size_t size)
-{
- return talloc_realloc((TALLOC_CTX *)context, ptr, size);
-}
-
/*
search the sam for the specified attributes - va_list varient
*/
return -1;
}
- ldb_set_alloc(sam_ctx->ldb, samdb_alloc, mem_ctx);
+ ldb_set_alloc(sam_ctx->ldb, talloc_ldb_alloc, mem_ctx);
count = ldb_search(sam_ctx->ldb, basedn, LDB_SCOPE_SUBTREE, expr, attrs, res);
TALLOC_CTX *mem_ctx, struct ldb_message **res)
{
struct samdb_context *sam_ctx = ctx;
- ldb_set_alloc(sam_ctx->ldb, samdb_alloc, mem_ctx);
+ ldb_set_alloc(sam_ctx->ldb, talloc_ldb_alloc, mem_ctx);
return ldb_search_free(sam_ctx->ldb, res);
}
if (s == NULL || a == NULL) {
return -1;
}
- ldb_set_alloc(sam_ctx->ldb, samdb_alloc, mem_ctx);
+ ldb_set_alloc(sam_ctx->ldb, talloc_ldb_alloc, mem_ctx);
return ldb_msg_add_string(sam_ctx->ldb, msg, a, s);
}
if (a == NULL) {
return -1;
}
- ldb_set_alloc(sam_ctx->ldb, samdb_alloc, mem_ctx);
+ ldb_set_alloc(sam_ctx->ldb, talloc_ldb_alloc, mem_ctx);
/* we use an empty replace rather than a delete, as it allows for
samdb_replace() to be used everywhere */
return ldb_msg_add_empty(sam_ctx->ldb, msg, a, LDB_FLAG_MOD_REPLACE);
return -1;
}
memcpy(val.data, hash.hash, 16);
- ldb_set_alloc(sam_ctx->ldb, samdb_alloc, mem_ctx);
+ ldb_set_alloc(sam_ctx->ldb, talloc_ldb_alloc, mem_ctx);
return ldb_msg_add_value(sam_ctx->ldb, msg, attr_name, &val);
}
for (i=0;i<count;i++) {
memcpy(i*16 + (char *)val.data, hashes[i].hash, 16);
}
- ldb_set_alloc(sam_ctx->ldb, samdb_alloc, mem_ctx);
+ ldb_set_alloc(sam_ctx->ldb, talloc_ldb_alloc, mem_ctx);
return ldb_msg_add_value(sam_ctx->ldb, msg, attr_name, &val);
}
struct ldb_val val;
val.length = hours.units_per_week / 8;
val.data = hours.bitmap;
- ldb_set_alloc(sam_ctx->ldb, samdb_alloc, mem_ctx);
+ ldb_set_alloc(sam_ctx->ldb, talloc_ldb_alloc, mem_ctx);
return ldb_msg_add_value(sam_ctx->ldb, msg, attr_name, &val);
}
struct samdb_context *sam_ctx = ctx;
struct ldb_message_element *el;
- ldb_set_alloc(sam_ctx->ldb, samdb_alloc, mem_ctx);
+ ldb_set_alloc(sam_ctx->ldb, talloc_ldb_alloc, mem_ctx);
el = ldb_msg_find_element(msg, attr_name);
if (el) {
{
struct samdb_context *sam_ctx = ctx;
- ldb_set_alloc(sam_ctx->ldb, samdb_alloc, mem_ctx);
+ ldb_set_alloc(sam_ctx->ldb, talloc_ldb_alloc, mem_ctx);
return ldb_add(sam_ctx->ldb, msg);
}
{
struct samdb_context *sam_ctx = ctx;
- ldb_set_alloc(sam_ctx->ldb, samdb_alloc, mem_ctx);
+ ldb_set_alloc(sam_ctx->ldb, talloc_ldb_alloc, mem_ctx);
return ldb_delete(sam_ctx->ldb, dn);
}
{
struct samdb_context *sam_ctx = ctx;
- ldb_set_alloc(sam_ctx->ldb, samdb_alloc, mem_ctx);
+ ldb_set_alloc(sam_ctx->ldb, talloc_ldb_alloc, mem_ctx);
return ldb_modify(sam_ctx->ldb, msg);
}