mirror of
https://github.com/samba-team/samba.git
synced 2025-11-21 12:23:50 +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:
committed by
Gerald (Jerry) Carter
parent
f7e636d408
commit
5b3575d930
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user