summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-06-13 05:18:17 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:18:02 -0500
commit87acba39f9e45eb6849cfd945ce6255bac5564c9 (patch)
treece5bf478de0a51ba246dbfdb6d21db12d6147a26 /source4
parent2be36bb85d0278a1f27f7202ed2c0e88a5f85a31 (diff)
downloadsamba-87acba39f9e45eb6849cfd945ce6255bac5564c9.tar.gz
samba-87acba39f9e45eb6849cfd945ce6255bac5564c9.tar.bz2
samba-87acba39f9e45eb6849cfd945ce6255bac5564c9.zip
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 used to be commit 5b3575d9303d54a771e080a670dcd2f444b10c20)
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/ldb/common/ldb_parse.c16
-rw-r--r--source4/lib/ldb/include/ldb_parse.h3
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_search.c2
3 files changed, 5 insertions, 16 deletions
diff --git a/source4/lib/ldb/common/ldb_parse.c b/source4/lib/ldb/common/ldb_parse.c
index 5221ef4556..e64e6d82d3 100644
--- a/source4/lib/ldb/common/ldb_parse.c
+++ b/source4/lib/ldb/common/ldb_parse.c
@@ -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);
-}
-
diff --git a/source4/lib/ldb/include/ldb_parse.h b/source4/lib/ldb/include/ldb_parse.h
index d9125d05ed..50a9382534 100644
--- a/source4/lib/ldb/include/ldb_parse.h
+++ b/source4/lib/ldb/include/ldb_parse.h
@@ -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
diff --git a/source4/lib/ldb/ldb_tdb/ldb_search.c b/source4/lib/ldb/ldb_tdb/ldb_search.c
index 7883ee6e7b..e036ae0966 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_search.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_search.c
@@ -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;