1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-22 16:23:49 +03:00

r7514: make the ldb_parse code not depend on a ldb_context, so we can now potentially use

it in our ldap client code, instead of replicating all the code
This commit is contained in:
Andrew Tridgell
2005-06-13 05:18:17 +00:00
committed by Gerald (Jerry) Carter
parent f7e636d408
commit 5b3575d930
3 changed files with 5 additions and 16 deletions

View File

@@ -43,7 +43,6 @@
#include "includes.h"
#include "ldb/include/ldb.h"
#include "ldb/include/ldb_private.h"
#include "ldb/include/ldb_parse.h"
#include <ctype.h>
@@ -327,22 +326,13 @@ static struct ldb_parse_tree *ldb_parse_filter(TALLOC_CTX *ctx, const char **s)
expression ::= <simple> | <filter>
*/
struct ldb_parse_tree *ldb_parse_tree(struct ldb_context *ldb, const char *s)
struct ldb_parse_tree *ldb_parse_tree(TALLOC_CTX *mem_ctx, const char *s)
{
while (isspace(*s)) s++;
if (*s == '(') {
return ldb_parse_filter(ldb, &s);
return ldb_parse_filter(mem_ctx, &s);
}
return ldb_parse_simple(ldb, s);
return ldb_parse_simple(mem_ctx, s);
}
/*
free a parse tree returned from ldb_parse_tree()
*/
void ldb_parse_tree_free(struct ldb_context *ldb, struct ldb_parse_tree *tree)
{
talloc_free(tree);
}

View File

@@ -54,7 +54,6 @@ struct ldb_parse_tree {
} u;
};
struct ldb_parse_tree *ldb_parse_tree(struct ldb_context *ldb, const char *s);
void ldb_parse_tree_free(struct ldb_context *ldb, struct ldb_parse_tree *tree);
struct ldb_parse_tree *ldb_parse_tree(TALLOC_CTX *mem_ctx, const char *s);
#endif

View File

@@ -506,7 +506,7 @@ int ltdb_search(struct ldb_module *module, const char *base,
}
}
ldb_parse_tree_free(ldb, tree);
talloc_free(tree);
ltdb_unlock_read(module);
return ret;