diff options
Diffstat (limited to 'source4/lib/ldb/common')
-rw-r--r-- | source4/lib/ldb/common/attrib_handlers.c | 2 | ||||
-rw-r--r-- | source4/lib/ldb/common/ldb.c | 17 | ||||
-rw-r--r-- | source4/lib/ldb/common/ldb_attributes.c | 3 | ||||
-rw-r--r-- | source4/lib/ldb/common/ldb_controls.c | 2 | ||||
-rw-r--r-- | source4/lib/ldb/common/ldb_debug.c | 2 | ||||
-rw-r--r-- | source4/lib/ldb/common/ldb_dn.c | 2 | ||||
-rw-r--r-- | source4/lib/ldb/common/ldb_ldif.c | 2 | ||||
-rw-r--r-- | source4/lib/ldb/common/ldb_match.c | 2 | ||||
-rw-r--r-- | source4/lib/ldb/common/ldb_modules.c | 42 | ||||
-rw-r--r-- | source4/lib/ldb/common/ldb_msg.c | 2 | ||||
-rw-r--r-- | source4/lib/ldb/common/ldb_parse.c | 2 | ||||
-rw-r--r-- | source4/lib/ldb/common/ldb_utf8.c | 2 | ||||
-rw-r--r-- | source4/lib/ldb/common/qsort.c | 2 |
13 files changed, 69 insertions, 13 deletions
diff --git a/source4/lib/ldb/common/attrib_handlers.c b/source4/lib/ldb/common/attrib_handlers.c index 5ec86b5b8f..80725ec04f 100644 --- a/source4/lib/ldb/common/attrib_handlers.c +++ b/source4/lib/ldb/common/attrib_handlers.c @@ -25,7 +25,7 @@ see rfc2252 */ -#include "ldb_includes.h" +#include "ldb_private.h" #include "system/locale.h" #include "ldb_handlers.h" diff --git a/source4/lib/ldb/common/ldb.c b/source4/lib/ldb/common/ldb.c index fe55d1499a..2fb5a8f9be 100644 --- a/source4/lib/ldb/common/ldb.c +++ b/source4/lib/ldb/common/ldb.c @@ -32,7 +32,7 @@ * Author: Andrew Tridgell */ -#include "ldb_includes.h" +#include "ldb_private.h" /* initialise a ldb context @@ -481,6 +481,11 @@ void ldb_set_create_perms(struct ldb_context *ldb, unsigned int perms) ldb->create_perms = perms; } +unsigned int ldb_get_create_perms(struct ldb_context *ldb) +{ + return ldb->create_perms; +} + void ldb_set_event_context(struct ldb_context *ldb, struct tevent_context *ev) { ldb->ev_ctx = ev; @@ -491,6 +496,16 @@ struct tevent_context * ldb_get_event_context(struct ldb_context *ldb) return ldb->ev_ctx; } +void ldb_request_set_state(struct ldb_request *req, int state) +{ + req->handle->state = state; +} + +int ldb_request_get_status(struct ldb_request *req) +{ + return req->handle->status; +} + /* start an ldb request NOTE: the request must be a talloc context. diff --git a/source4/lib/ldb/common/ldb_attributes.c b/source4/lib/ldb/common/ldb_attributes.c index 001bc45ee1..9fa0fb2ccd 100644 --- a/source4/lib/ldb/common/ldb_attributes.c +++ b/source4/lib/ldb/common/ldb_attributes.c @@ -28,7 +28,8 @@ message matching logic generic */ -#include "ldb_includes.h" +#include "ldb_private.h" +#include "ldb_handlers.h" /* add a attribute to the ldb_schema diff --git a/source4/lib/ldb/common/ldb_controls.c b/source4/lib/ldb/common/ldb_controls.c index 6fad5012b6..0c587e0905 100644 --- a/source4/lib/ldb/common/ldb_controls.c +++ b/source4/lib/ldb/common/ldb_controls.c @@ -31,7 +31,7 @@ * Author: Simo Sorce */ -#include "ldb_includes.h" +#include "ldb_private.h" /* check if a control with the specified "oid" exist and return it */ /* returns NULL if not found */ diff --git a/source4/lib/ldb/common/ldb_debug.c b/source4/lib/ldb/common/ldb_debug.c index 0f78e37c1c..f8009eb8a3 100644 --- a/source4/lib/ldb/common/ldb_debug.c +++ b/source4/lib/ldb/common/ldb_debug.c @@ -31,7 +31,7 @@ * Author: Andrew Tridgell */ -#include "ldb_includes.h" +#include "ldb_private.h" /* this allows the user to choose their own debug function diff --git a/source4/lib/ldb/common/ldb_dn.c b/source4/lib/ldb/common/ldb_dn.c index 02e21a2b25..402d629501 100644 --- a/source4/lib/ldb/common/ldb_dn.c +++ b/source4/lib/ldb/common/ldb_dn.c @@ -33,7 +33,7 @@ * Author: Simo Sorce */ -#include "ldb_includes.h" +#include "ldb_private.h" #include <ctype.h> #define LDB_DN_NULL_FAILED(x) if (!(x)) goto failed diff --git a/source4/lib/ldb/common/ldb_ldif.c b/source4/lib/ldb/common/ldb_ldif.c index 619c10e11e..400fb352ff 100644 --- a/source4/lib/ldb/common/ldb_ldif.c +++ b/source4/lib/ldb/common/ldb_ldif.c @@ -35,7 +35,7 @@ see RFC2849 for the LDIF format definition */ -#include "ldb_includes.h" +#include "ldb_private.h" #include "system/locale.h" /* diff --git a/source4/lib/ldb/common/ldb_match.c b/source4/lib/ldb/common/ldb_match.c index 4cde739d67..c622701d30 100644 --- a/source4/lib/ldb/common/ldb_match.c +++ b/source4/lib/ldb/common/ldb_match.c @@ -32,7 +32,7 @@ * Author: Andrew Tridgell */ -#include "ldb_includes.h" +#include "ldb_private.h" /* check if the scope matches in a search result diff --git a/source4/lib/ldb/common/ldb_modules.c b/source4/lib/ldb/common/ldb_modules.c index 8db28d262c..99a47767e1 100644 --- a/source4/lib/ldb/common/ldb_modules.c +++ b/source4/lib/ldb/common/ldb_modules.c @@ -31,7 +31,7 @@ * Author: Simo Sorce */ -#include "ldb_includes.h" +#include "ldb_private.h" #if (_SAMBA_BUILD_ >= 4) #include "includes.h" @@ -486,6 +486,46 @@ int ldb_load_modules(struct ldb_context *ldb, const char *options[]) } while (0) +struct ldb_module *ldb_module_new(TALLOC_CTX *memctx, + struct ldb_context *ldb, + const char *module_name, + const struct ldb_module_ops *ops) +{ + struct ldb_module *module; + + module = talloc(memctx, struct ldb_module); + if (!module) { + ldb_oom(ldb); + return NULL; + } + talloc_set_name_const(module, module_name); + module->ldb = ldb; + module->prev = module->next = NULL; + module->ops = ops; + + return module; +} + +const char * ldb_module_get_name(struct ldb_module *module) +{ + return module->ops->name; +} + +struct ldb_context *ldb_module_get_ctx(struct ldb_module *module) +{ + return module->ldb; +} + +void *ldb_module_get_private(struct ldb_module *module) +{ + return module->private_data; +} + +void ldb_module_set_private(struct ldb_module *module, void *private_data) +{ + module->private_data = private_data; +} + /* helper functions to call the next module in chain */ diff --git a/source4/lib/ldb/common/ldb_msg.c b/source4/lib/ldb/common/ldb_msg.c index 2f5fe1d18c..ad53a3d29d 100644 --- a/source4/lib/ldb/common/ldb_msg.c +++ b/source4/lib/ldb/common/ldb_msg.c @@ -31,7 +31,7 @@ * Author: Andrew Tridgell */ -#include "ldb_includes.h" +#include "ldb_private.h" /* create a new ldb_message in a given memory context (NULL for top level) diff --git a/source4/lib/ldb/common/ldb_parse.c b/source4/lib/ldb/common/ldb_parse.c index b233975220..654a635abf 100644 --- a/source4/lib/ldb/common/ldb_parse.c +++ b/source4/lib/ldb/common/ldb_parse.c @@ -40,7 +40,7 @@ */ -#include "ldb_includes.h" +#include "ldb_private.h" #include "system/locale.h" /* diff --git a/source4/lib/ldb/common/ldb_utf8.c b/source4/lib/ldb/common/ldb_utf8.c index 69ee2b6964..0a8a89ac1d 100644 --- a/source4/lib/ldb/common/ldb_utf8.c +++ b/source4/lib/ldb/common/ldb_utf8.c @@ -31,7 +31,7 @@ * Author: Andrew Tridgell */ -#include "ldb_includes.h" +#include "ldb_private.h" #include "system/locale.h" diff --git a/source4/lib/ldb/common/qsort.c b/source4/lib/ldb/common/qsort.c index 0fa76d3b47..1a0b886b8c 100644 --- a/source4/lib/ldb/common/qsort.c +++ b/source4/lib/ldb/common/qsort.c @@ -23,7 +23,7 @@ * Simo Sorce <idra@samba.org> 2005 */ -#include "ldb_includes.h" +#include "ldb_private.h" /* Byte-wise swap two items of size SIZE. */ #define SWAP(a, b, size) \ |