int ldb_build_search_req_ex(struct ldb_request **ret_req,
struct ldb_context *ldb,
- void *mem_ctx,
+ TALLOC_CTX *mem_ctx,
struct ldb_dn *base,
enum ldb_scope scope,
struct ldb_parse_tree *tree,
int ldb_build_search_req(struct ldb_request **ret_req,
struct ldb_context *ldb,
- void *mem_ctx,
+ TALLOC_CTX *mem_ctx,
struct ldb_dn *base,
enum ldb_scope scope,
const char *expression,
int ldb_build_add_req(struct ldb_request **ret_req,
struct ldb_context *ldb,
- void *mem_ctx,
+ TALLOC_CTX *mem_ctx,
const struct ldb_message *message,
struct ldb_control **controls,
void *context,
int ldb_build_mod_req(struct ldb_request **ret_req,
struct ldb_context *ldb,
- void *mem_ctx,
+ TALLOC_CTX *mem_ctx,
const struct ldb_message *message,
struct ldb_control **controls,
void *context,
int ldb_build_del_req(struct ldb_request **ret_req,
struct ldb_context *ldb,
- void *mem_ctx,
+ TALLOC_CTX *mem_ctx,
struct ldb_dn *dn,
struct ldb_control **controls,
void *context,
int ldb_build_rename_req(struct ldb_request **ret_req,
struct ldb_context *ldb,
- void *mem_ctx,
+ TALLOC_CTX *mem_ctx,
struct ldb_dn *olddn,
struct ldb_dn *newdn,
struct ldb_control **controls,
int ldb_build_extended_req(struct ldb_request **ret_req,
struct ldb_context *ldb,
- void *mem_ctx,
+ TALLOC_CTX *mem_ctx,
const char *oid,
void *data,
struct ldb_control **controls,
/* Parse controls from the format used on the command line and in ejs */
-struct ldb_control **ldb_parse_control_strings(struct ldb_context *ldb, void *mem_ctx, const char **control_strings)
+struct ldb_control **ldb_parse_control_strings(struct ldb_context *ldb, TALLOC_CTX *mem_ctx, const char **control_strings)
{
unsigned int i;
struct ldb_control **ctrl;
}
/* strdn may be NULL */
-struct ldb_dn *ldb_dn_from_ldb_val(void *mem_ctx,
+struct ldb_dn *ldb_dn_from_ldb_val(TALLOC_CTX *mem_ctx,
struct ldb_context *ldb,
const struct ldb_val *strdn)
{
}
/* strdn may be NULL */
-struct ldb_dn *ldb_dn_new(void *mem_ctx,
+struct ldb_dn *ldb_dn_new(TALLOC_CTX *mem_ctx,
struct ldb_context *ldb,
const char *strdn)
{
return ldb_dn_from_ldb_val(mem_ctx, ldb, &blob);
}
-struct ldb_dn *ldb_dn_new_fmt(void *mem_ctx,
+struct ldb_dn *ldb_dn_new_fmt(TALLOC_CTX *mem_ctx,
struct ldb_context *ldb,
const char *new_fmt, ...)
{
return (l + (d - dst));
}
-char *ldb_dn_escape_value(void *mem_ctx, struct ldb_val value)
+char *ldb_dn_escape_value(TALLOC_CTX *mem_ctx, struct ldb_val value)
{
char *dst;
return strcmp(ec1->name, ec2->name);
}
-char *ldb_dn_get_extended_linearized(void *mem_ctx, struct ldb_dn *dn, int mode)
+char *ldb_dn_get_extended_linearized(TALLOC_CTX *mem_ctx, struct ldb_dn *dn, int mode)
{
const char *linearized = ldb_dn_get_linearized(dn);
char *p = NULL;
}
-char *ldb_dn_alloc_linearized(void *mem_ctx, struct ldb_dn *dn)
+char *ldb_dn_alloc_linearized(TALLOC_CTX *mem_ctx, struct ldb_dn *dn)
{
return talloc_strdup(mem_ctx, ldb_dn_get_linearized(dn));
}
return dn->casefold;
}
-char *ldb_dn_alloc_casefold(void *mem_ctx, struct ldb_dn *dn)
+char *ldb_dn_alloc_casefold(TALLOC_CTX *mem_ctx, struct ldb_dn *dn)
{
return talloc_strdup(mem_ctx, ldb_dn_get_casefold(dn));
}
}
static struct ldb_dn_component ldb_dn_copy_component(
- void *mem_ctx,
+ TALLOC_CTX *mem_ctx,
struct ldb_dn_component *src)
{
struct ldb_dn_component dst;
}
static struct ldb_dn_ext_component ldb_dn_ext_copy_component(
- void *mem_ctx,
+ TALLOC_CTX *mem_ctx,
struct ldb_dn_ext_component *src)
{
struct ldb_dn_ext_component dst;
return dst;
}
-struct ldb_dn *ldb_dn_copy(void *mem_ctx, struct ldb_dn *dn)
+struct ldb_dn *ldb_dn_copy(TALLOC_CTX *mem_ctx, struct ldb_dn *dn)
{
struct ldb_dn *new_dn;
return true;
}
-struct ldb_dn *ldb_dn_get_parent(void *mem_ctx, struct ldb_dn *dn)
+struct ldb_dn *ldb_dn_get_parent(TALLOC_CTX *mem_ctx, struct ldb_dn *dn)
{
struct ldb_dn *new_dn;
the EX format has the last '/' replaced with a newline (\n).
*/
-static char *ldb_dn_canonical(void *mem_ctx, struct ldb_dn *dn, int ex_format) {
+static char *ldb_dn_canonical(TALLOC_CTX *mem_ctx, struct ldb_dn *dn, int ex_format) {
long long int i;
TALLOC_CTX *tmpctx;
char *cracked = NULL;
}
/* Wrapper functions for the above, for the two different string formats */
-char *ldb_dn_canonical_string(void *mem_ctx, struct ldb_dn *dn) {
+char *ldb_dn_canonical_string(TALLOC_CTX *mem_ctx, struct ldb_dn *dn) {
return ldb_dn_canonical(mem_ctx, dn, 0);
}
-char *ldb_dn_canonical_ex_string(void *mem_ctx, struct ldb_dn *dn) {
+char *ldb_dn_canonical_ex_string(TALLOC_CTX *mem_ctx, struct ldb_dn *dn) {
return ldb_dn_canonical(mem_ctx, dn, 1);
}
/*
*/
-static int ldb_read_data_file(void *mem_ctx, struct ldb_val *value)
+static int ldb_read_data_file(TALLOC_CTX *mem_ctx, struct ldb_val *value)
{
struct stat statbuf;
char *buf;
encode as base64
caller frees
*/
-char *ldb_base64_encode(void *mem_ctx, const char *buf, int len)
+char *ldb_base64_encode(TALLOC_CTX *mem_ctx, const char *buf, int len)
{
const char *b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
int bit_offset, byte_offset, idx, i;
/* simple ldif attribute parser */
-static int next_attr(void *mem_ctx, char **s, const char **attr, struct ldb_val *value)
+static int next_attr(TALLOC_CTX *mem_ctx, char **s, const char **attr, struct ldb_val *value)
{
char *p;
int base64_encoded = 0;
/*
create a new ldb_message in a given memory context (NULL for top level)
*/
-struct ldb_message *ldb_msg_new(void *mem_ctx)
+struct ldb_message *ldb_msg_new(TALLOC_CTX *mem_ctx)
{
return talloc_zero(mem_ctx, struct ldb_message);
}
/*
duplicate a ldb_val structure
*/
-struct ldb_val ldb_val_dup(void *mem_ctx, const struct ldb_val *v)
+struct ldb_val ldb_val_dup(TALLOC_CTX *mem_ctx, const struct ldb_val *v)
{
struct ldb_val v2;
v2.length = v->length;
}
struct ldb_dn *ldb_msg_find_attr_as_dn(struct ldb_context *ldb,
- void *mem_ctx,
+ TALLOC_CTX *mem_ctx,
const struct ldb_message *msg,
const char *attr_name)
{
decode a RFC2254 binary string representation of a buffer.
Used in LDAP filters.
*/
-struct ldb_val ldb_binary_decode(void *mem_ctx, const char *str)
+struct ldb_val ldb_binary_decode(TALLOC_CTX *mem_ctx, const char *str)
{
size_t i, j;
struct ldb_val ret;
encode a blob as a RFC2254 binary string, escaping any
non-printable or '\' characters
*/
-char *ldb_binary_encode(void *mem_ctx, struct ldb_val val)
+char *ldb_binary_encode(TALLOC_CTX *mem_ctx, struct ldb_val val)
{
size_t i;
char *ret;
non-printable or '\' characters. This routine is suitable for use
in escaping user data in ldap filters.
*/
-char *ldb_binary_encode_string(void *mem_ctx, const char *string)
+char *ldb_binary_encode_string(TALLOC_CTX *mem_ctx, const char *string)
{
struct ldb_val val;
val.data = discard_const_p(uint8_t, string);
/* return a NULL terminated list of binary strings representing the value
chunks separated by wildcards that makes the value portion of the filter
*/
-static struct ldb_val **ldb_wildcard_decode(void *mem_ctx, const char *string)
+static struct ldb_val **ldb_wildcard_decode(TALLOC_CTX *mem_ctx, const char *string)
{
struct ldb_val **ret = NULL;
unsigned int val = 0;
return ret;
}
-static struct ldb_parse_tree *ldb_parse_filter(void *mem_ctx, const char **s);
+static struct ldb_parse_tree *ldb_parse_filter(TALLOC_CTX *mem_ctx, const char **s);
/*
return NULL;
}
-static enum ldb_parse_op ldb_parse_filtertype(void *mem_ctx, char **type, char **value, const char **s)
+static enum ldb_parse_op ldb_parse_filtertype(TALLOC_CTX *mem_ctx, char **type, char **value, const char **s)
{
enum ldb_parse_op filter = 0;
char *name, *val, *k;
/*
<simple> ::= <attributetype> <filtertype> <attributevalue>
*/
-static struct ldb_parse_tree *ldb_parse_simple(void *mem_ctx, const char **s)
+static struct ldb_parse_tree *ldb_parse_simple(TALLOC_CTX *mem_ctx, const char **s)
{
char *attr, *value;
struct ldb_parse_tree *ret;
<or> ::= '|' <filterlist>
<filterlist> ::= <filter> | <filter> <filterlist>
*/
-static struct ldb_parse_tree *ldb_parse_filterlist(void *mem_ctx, const char **s)
+static struct ldb_parse_tree *ldb_parse_filterlist(TALLOC_CTX *mem_ctx, const char **s)
{
struct ldb_parse_tree *ret, *next;
enum ldb_parse_op op;
/*
<not> ::= '!' <filter>
*/
-static struct ldb_parse_tree *ldb_parse_not(void *mem_ctx, const char **s)
+static struct ldb_parse_tree *ldb_parse_not(TALLOC_CTX *mem_ctx, const char **s)
{
struct ldb_parse_tree *ret;
const char *p = *s;
parse a filtercomp
<filtercomp> ::= <and> | <or> | <not> | <simple>
*/
-static struct ldb_parse_tree *ldb_parse_filtercomp(void *mem_ctx, const char **s)
+static struct ldb_parse_tree *ldb_parse_filtercomp(TALLOC_CTX *mem_ctx, const char **s)
{
struct ldb_parse_tree *ret;
const char *p = *s;
/*
<filter> ::= '(' <filtercomp> ')'
*/
-static struct ldb_parse_tree *ldb_parse_filter(void *mem_ctx, const char **s)
+static struct ldb_parse_tree *ldb_parse_filter(TALLOC_CTX *mem_ctx, const char **s)
{
struct ldb_parse_tree *ret;
const char *p = *s;
expression ::= <simple> | <filter>
*/
-struct ldb_parse_tree *ldb_parse_tree(void *mem_ctx, const char *s)
+struct ldb_parse_tree *ldb_parse_tree(TALLOC_CTX *mem_ctx, const char *s)
{
if (s == NULL || *s == 0) {
s = "(|(objectClass=*)(distinguishedName=*))";
/*
construct a ldap parse filter given a parse tree
*/
-char *ldb_filter_from_tree(void *mem_ctx, struct ldb_parse_tree *tree)
+char *ldb_filter_from_tree(TALLOC_CTX *mem_ctx, struct ldb_parse_tree *tree)
{
char *s, *s2, *ret;
unsigned int i;
a simple case folding function
NOTE: does not handle UTF8
*/
-char *ldb_casefold_default(void *context, void *mem_ctx, const char *s, size_t n)
+char *ldb_casefold_default(void *context, TALLOC_CTX *mem_ctx, const char *s, size_t n)
{
size_t i;
char *ret = talloc_strndup(mem_ctx, s, n);
ldb_set_utf8_fns(ldb, NULL, ldb_casefold_default);
}
-char *ldb_casefold(struct ldb_context *ldb, void *mem_ctx, const char *s, size_t n)
+char *ldb_casefold(struct ldb_context *ldb, TALLOC_CTX *mem_ctx, const char *s, size_t n)
{
return ldb->utf8_fns.casefold(ldb->utf8_fns.context, mem_ctx, s, n);
}
return 1;
}
-char *ldb_attr_casefold(void *mem_ctx, const char *s)
+char *ldb_attr_casefold(TALLOC_CTX *mem_ctx, const char *s)
{
size_t i;
char *ret = talloc_strdup(mem_ctx, s);
\param dn The DN to linearize
\param mode Style of extended DN to return (0 is HEX representation of binary form, 1 is a string form)
*/
-char *ldb_dn_get_extended_linearized(void *mem_ctx, struct ldb_dn *dn, int mode);
+char *ldb_dn_get_extended_linearized(TALLOC_CTX *mem_ctx, struct ldb_dn *dn, int mode);
const struct ldb_val *ldb_dn_get_extended_component(struct ldb_dn *dn, const char *name);
int ldb_dn_set_extended_component(struct ldb_dn *dn, const char *name, const struct ldb_val *val);
void ldb_dn_extended_filter(struct ldb_dn *dn, const char * const *accept);
\note The DN will not be parsed at this time. Use ldb_dn_validate to tell if the DN is syntacticly correct
*/
-struct ldb_dn *ldb_dn_from_ldb_val(void *mem_ctx, struct ldb_context *ldb, const struct ldb_val *strdn);
+struct ldb_dn *ldb_dn_from_ldb_val(TALLOC_CTX *mem_ctx, struct ldb_context *ldb, const struct ldb_val *strdn);
/**
Determine if this DN is syntactically valid
void ldb_set_flags(struct ldb_context *ldb, unsigned flags);
-struct ldb_dn *ldb_dn_binary_from_ldb_val(void *mem_ctx,
+struct ldb_dn *ldb_dn_binary_from_ldb_val(TALLOC_CTX *mem_ctx,
struct ldb_context *ldb,
const struct ldb_val *strdn);
int ldb_subclass_add(struct ldb_context *ldb, const char *classname, const char *subclass);
/* The following definitions come from lib/ldb/common/ldb_utf8.c */
-char *ldb_casefold_default(void *context, void *mem_ctx, const char *s, size_t n);
+char *ldb_casefold_default(void *context, TALLOC_CTX *mem_ctx, const char *s, size_t n);
void ldb_dump_results(struct ldb_context *ldb, struct ldb_result *result, FILE *f);
int ldb_load_modules(struct ldb_context *ldb, const char *options[]);
int ldb_init_module_chain(struct ldb_context *ldb, struct ldb_module *module);
-struct ldb_val ldb_binary_decode(void *mem_ctx, const char *str);
+struct ldb_val ldb_binary_decode(TALLOC_CTX *mem_ctx, const char *str);
/* The following definitions come from lib/ldb/common/ldb_options.c */