From 6dbcffb51d979094cbdac80df5e9480475230137 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 16 Jun 2010 13:43:38 +0200 Subject: s4:lib: merge LDB_WRAP and LDBSAMBA and make LDBSAMBA a library. This is needed to remove samba specifc symbols from the bundled ldb, in order to get the ABI right. metze Signed-off-by: Andreas Schneider --- source4/dsdb/wscript_build | 2 +- source4/ldap_server/ldap_backend.c | 2 +- source4/lib/ldb-samba/ldb_wrap.c | 284 ++++++++++++++++++++++++++++ source4/lib/ldb-samba/ldb_wrap.h | 43 +++++ source4/lib/ldb-samba/wscript_build | 7 +- source4/lib/ldb_wrap.c | 284 ---------------------------- source4/lib/ldb_wrap.h | 43 ----- source4/lib/registry/wscript_build | 2 +- source4/lib/wscript_build | 8 - source4/libnet/libnet_become_dc.c | 2 +- source4/libnet/libnet_unbecome_dc.c | 2 +- source4/libnet/libnet_vampire.c | 2 +- source4/libnet/wscript_build | 1 - source4/param/provision.c | 1 - source4/param/wscript_build | 2 +- source4/smbd/process_onefork.c | 2 +- source4/smbd/process_prefork.c | 2 +- source4/smbd/process_standard.c | 2 +- source4/smbd/wscript_build | 2 +- source4/torture/drs/unit/schemainfo_tests.c | 2 +- source4/torture/libnet/libnet_BecomeDC.c | 2 +- source4/torture/libnet/utils.c | 2 +- source4/torture/local/dbspeed.c | 2 +- source4/torture/rpc/dsgetinfo.c | 1 - source4/torture/rpc/dssync.c | 1 - source4/torture/rpc/netlogon.c | 2 +- source4/torture/wscript_build | 2 +- source4/utils/net/drs/net_drs.c | 2 +- source4/winbind/idmap.c | 2 +- 29 files changed, 350 insertions(+), 361 deletions(-) create mode 100644 source4/lib/ldb-samba/ldb_wrap.c create mode 100644 source4/lib/ldb-samba/ldb_wrap.h delete mode 100644 source4/lib/ldb_wrap.c delete mode 100644 source4/lib/ldb_wrap.h (limited to 'source4') diff --git a/source4/dsdb/wscript_build b/source4/dsdb/wscript_build index 0a1ea1cc7f..3b3dae9e66 100644 --- a/source4/dsdb/wscript_build +++ b/source4/dsdb/wscript_build @@ -6,7 +6,7 @@ bld.SAMBA_SUBSYSTEM('SAMDB', source='samdb/samdb.c samdb/samdb_privilege.c samdb/cracknames.c repl/replicated_objects.c', autoproto='samdb/samdb_proto.h', public_deps='HEIMDAL_KRB5', - deps='LIBNDR NDR_DRSUAPI NDR_DRSBLOBS NSS_WRAPPER auth_system_session LIBCLI_AUTH LIBNDR SAMDB_SCHEMA LDB_WRAP SAMDB_COMMON LIBCLI_DRSUAPI LIBCLI_LDAP_NDR LIBSAMBA-UTIL' + deps='LIBNDR NDR_DRSUAPI NDR_DRSBLOBS NSS_WRAPPER auth_system_session LIBCLI_AUTH LIBNDR SAMDB_SCHEMA LDBSAMBA SAMDB_COMMON LIBCLI_DRSUAPI LIBCLI_LDAP_NDR LIBSAMBA-UTIL' ) diff --git a/source4/ldap_server/ldap_backend.c b/source4/ldap_server/ldap_backend.c index 7767d053b8..34d59b53cd 100644 --- a/source4/ldap_server/ldap_backend.c +++ b/source4/ldap_server/ldap_backend.c @@ -27,7 +27,7 @@ #include "smbd/service_stream.h" #include "dsdb/samdb/samdb.h" #include "lib/ldb/include/ldb_errors.h" -#include "lib/ldb_wrap.h" +#include "ldb_wrap.h" #define VALID_DN_SYNTAX(dn) do {\ if (!(dn)) {\ diff --git a/source4/lib/ldb-samba/ldb_wrap.c b/source4/lib/ldb-samba/ldb_wrap.c new file mode 100644 index 0000000000..d7503829b1 --- /dev/null +++ b/source4/lib/ldb-samba/ldb_wrap.c @@ -0,0 +1,284 @@ +/* + Unix SMB/CIFS implementation. + + LDB wrap functions + + Copyright (C) Andrew Tridgell 2004-2009 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/* + the stupidity of the unix fcntl locking design forces us to never + allow a database file to be opened twice in the same process. These + wrappers provide convenient access to a tdb or ldb, taking advantage + of talloc destructors to ensure that only a single open is done +*/ + +#include "includes.h" +#include "lib/events/events.h" +#include "lib/ldb/include/ldb.h" +#include "lib/ldb/include/ldb_errors.h" +#include "lib/ldb-samba/ldif_handlers.h" +#include "ldb_wrap.h" +#include "dsdb/samdb/samdb.h" +#include "param/param.h" +#include "../lib/util/dlinklist.h" +#include "../tdb/include/tdb.h" + +/* + this is used to catch debug messages from ldb +*/ +static void ldb_wrap_debug(void *context, enum ldb_debug_level level, + const char *fmt, va_list ap) PRINTF_ATTRIBUTE(3,0); + +static void ldb_wrap_debug(void *context, enum ldb_debug_level level, + const char *fmt, va_list ap) +{ + int samba_level = -1; + char *s = NULL; + switch (level) { + case LDB_DEBUG_FATAL: + samba_level = 0; + break; + case LDB_DEBUG_ERROR: + samba_level = 1; + break; + case LDB_DEBUG_WARNING: + samba_level = 2; + break; + case LDB_DEBUG_TRACE: + samba_level = 5; + break; + + }; + vasprintf(&s, fmt, ap); + if (!s) return; + DEBUG(samba_level, ("ldb: %s\n", s)); + free(s); +} + + +/* + connecting to a ldb can be a relatively expensive operation because + of the schema and partition loads. We keep a list of open ldb + contexts here, and try to re-use when possible. + + This means callers of ldb_wrap_connect() must use talloc_unlink() or + the free of a parent to destroy the context + */ +static struct ldb_wrap { + struct ldb_wrap *next, *prev; + struct ldb_wrap_context { + /* the context is what we use to tell if two ldb + * connections are exactly equivalent + */ + const char *url; + struct tevent_context *ev; + struct loadparm_context *lp_ctx; + struct auth_session_info *session_info; + struct cli_credentials *credentials; + unsigned int flags; + } context; + struct ldb_context *ldb; +} *ldb_wrap_list; + +/* + see if two database opens are equivalent + */ +static bool ldb_wrap_same_context(const struct ldb_wrap_context *c1, + const struct ldb_wrap_context *c2) +{ + return (c1->ev == c2->ev && + c1->lp_ctx == c2->lp_ctx && + c1->session_info == c2->session_info && + c1->credentials == c2->credentials && + c1->flags == c2->flags && + (c1->url == c2->url || strcmp(c1->url, c2->url) == 0)); +} + +/* + free a ldb_wrap structure + */ +static int ldb_wrap_destructor(struct ldb_wrap *w) +{ + DLIST_REMOVE(ldb_wrap_list, w); + return 0; +} + +/* + wrapped connection to a ldb database + to close just talloc_free() the returned ldb_context + + TODO: We need an error_string parameter + */ + struct ldb_context *ldb_wrap_connect(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + struct loadparm_context *lp_ctx, + const char *url, + struct auth_session_info *session_info, + struct cli_credentials *credentials, + unsigned int flags) +{ + struct ldb_context *ldb; + int ret; + char *real_url = NULL; + struct ldb_wrap *w; + struct ldb_wrap_context c; + + c.url = url; + c.ev = ev; + c.lp_ctx = lp_ctx; + c.session_info = session_info; + c.credentials = credentials; + c.flags = flags; + + /* see if we can re-use an existing ldb */ + for (w=ldb_wrap_list; w; w=w->next) { + if (ldb_wrap_same_context(&c, &w->context)) { + return talloc_reference(mem_ctx, w->ldb); + } + } + + /* we want to use the existing event context if possible. This + relies on the fact that in smbd, everything is a child of + the main event_context */ + if (ev == NULL) { + return NULL; + } + + ldb = ldb_init(mem_ctx, ev); + if (ldb == NULL) { + return NULL; + } + + ldb_set_modules_dir(ldb, + talloc_asprintf(ldb, + "%s/ldb", + lp_modulesdir(lp_ctx))); + + if (ldb_set_opaque(ldb, "sessionInfo", session_info)) { + talloc_free(ldb); + return NULL; + } + + if (ldb_set_opaque(ldb, "credentials", credentials)) { + talloc_free(ldb); + return NULL; + } + + if (ldb_set_opaque(ldb, "loadparm", lp_ctx)) { + talloc_free(ldb); + return NULL; + } + + /* This must be done before we load the schema, as these + * handlers for objectSid and objectGUID etc must take + * precedence over the 'binary attribute' declaration in the + * schema */ + ret = ldb_register_samba_handlers(ldb); + if (ret == -1) { + talloc_free(ldb); + return NULL; + } + + if (lp_ctx != NULL && strcmp(lp_sam_url(lp_ctx), url) == 0) { + dsdb_set_global_schema(ldb); + } + + ldb_set_debug(ldb, ldb_wrap_debug, NULL); + + ldb_set_utf8_fns(ldb, NULL, wrap_casefold); + + real_url = private_path(ldb, lp_ctx, url); + if (real_url == NULL) { + talloc_free(ldb); + return NULL; + } + + /* allow admins to force non-sync ldb for all databases */ + if (lp_parm_bool(lp_ctx, NULL, "ldb", "nosync", false)) { + flags |= LDB_FLG_NOSYNC; + } + + if (DEBUGLVL(10)) { + flags |= LDB_FLG_ENABLE_TRACING; + } + + /* we usually want Samba databases to be private. If we later + find we need one public, we will need to add a parameter to + ldb_wrap_connect() */ + ldb_set_create_perms(ldb, 0600); + + ret = ldb_connect(ldb, real_url, flags, NULL); + if (ret != LDB_SUCCESS) { + talloc_free(ldb); + return NULL; + } + + /* setup for leak detection */ + ldb_set_opaque(ldb, "wrap_url", real_url); + + /* add to the list of open ldb contexts */ + w = talloc(ldb, struct ldb_wrap); + if (w == NULL) { + talloc_free(ldb); + return NULL; + } + + w->context = c; + w->context.url = talloc_strdup(w, url); + if (w->context.url == NULL) { + talloc_free(ldb); + return NULL; + } + + w->ldb = ldb; + + DLIST_ADD(ldb_wrap_list, w); + + /* make the resulting schema global */ + if (lp_ctx != NULL && strcmp(lp_sam_url(lp_ctx), url) == 0) { + struct dsdb_schema *schema = dsdb_get_schema(ldb, NULL); + if (schema) { + dsdb_make_schema_global(ldb, schema); + } + } + + DEBUG(3,("ldb_wrap open of %s\n", url)); + + talloc_set_destructor(w, ldb_wrap_destructor); + + return ldb; +} + +/* + when we fork() we need to make sure that any open ldb contexts have + any open transactions cancelled + */ + void ldb_wrap_fork_hook(void) +{ + struct ldb_wrap *w; + + for (w=ldb_wrap_list; w; w=w->next) { + if (ldb_transaction_cancel_noerr(w->ldb) != LDB_SUCCESS) { + smb_panic("Failed to cancel child transactions\n"); + } + } + + if (tdb_reopen_all(1) == -1) { + smb_panic("tdb_reopen_all failed\n"); + } +} + diff --git a/source4/lib/ldb-samba/ldb_wrap.h b/source4/lib/ldb-samba/ldb_wrap.h new file mode 100644 index 0000000000..650f97d17d --- /dev/null +++ b/source4/lib/ldb-samba/ldb_wrap.h @@ -0,0 +1,43 @@ +/* + Unix SMB/CIFS implementation. + + database wrap headers + + Copyright (C) Andrew Tridgell 2004 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef _LDB_WRAP_H_ +#define _LDB_WRAP_H_ + +struct auth_session_info; +struct ldb_message; +struct ldb_dn; +struct cli_credentials; +struct loadparm_context; +struct tevent_context; + +char *wrap_casefold(void *context, void *mem_ctx, const char *s, size_t n); + +struct ldb_context *ldb_wrap_connect(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + struct loadparm_context *lp_ctx, + const char *url, + struct auth_session_info *session_info, + struct cli_credentials *credentials, + unsigned int flags); + +void ldb_wrap_fork_hook(void); +#endif /* _LDB_WRAP_H_ */ diff --git a/source4/lib/ldb-samba/wscript_build b/source4/lib/ldb-samba/wscript_build index 15f031ba37..048cea37f4 100644 --- a/source4/lib/ldb-samba/wscript_build +++ b/source4/lib/ldb-samba/wscript_build @@ -1,11 +1,12 @@ #!/usr/bin/env python -bld.SAMBA_SUBSYSTEM('LDBSAMBA', - source='ldif_handlers.c', +bld.SAMBA_LIBRARY('LDBSAMBA', + source='ldif_handlers.c ldb_wrap.c', autoproto='ldif_handlers_proto.h', public_deps='ldb', - deps='LIBSECURITY SAMDB_SCHEMA LIBNDR NDR_DRSBLOBS CREDENTIALS' + public_headers='ldb_wrap.h', + deps='LIBSECURITY SAMDB_SCHEMA LIBNDR NDR_DRSBLOBS CREDENTIALS UTIL_LDB' ) diff --git a/source4/lib/ldb_wrap.c b/source4/lib/ldb_wrap.c deleted file mode 100644 index 8bcfb58f61..0000000000 --- a/source4/lib/ldb_wrap.c +++ /dev/null @@ -1,284 +0,0 @@ -/* - Unix SMB/CIFS implementation. - - LDB wrap functions - - Copyright (C) Andrew Tridgell 2004-2009 - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -/* - the stupidity of the unix fcntl locking design forces us to never - allow a database file to be opened twice in the same process. These - wrappers provide convenient access to a tdb or ldb, taking advantage - of talloc destructors to ensure that only a single open is done -*/ - -#include "includes.h" -#include "lib/events/events.h" -#include "lib/ldb/include/ldb.h" -#include "lib/ldb/include/ldb_errors.h" -#include "lib/ldb-samba/ldif_handlers.h" -#include "ldb_wrap.h" -#include "dsdb/samdb/samdb.h" -#include "param/param.h" -#include "../lib/util/dlinklist.h" -#include "../tdb/include/tdb.h" - -/* - this is used to catch debug messages from ldb -*/ -static void ldb_wrap_debug(void *context, enum ldb_debug_level level, - const char *fmt, va_list ap) PRINTF_ATTRIBUTE(3,0); - -static void ldb_wrap_debug(void *context, enum ldb_debug_level level, - const char *fmt, va_list ap) -{ - int samba_level = -1; - char *s = NULL; - switch (level) { - case LDB_DEBUG_FATAL: - samba_level = 0; - break; - case LDB_DEBUG_ERROR: - samba_level = 1; - break; - case LDB_DEBUG_WARNING: - samba_level = 2; - break; - case LDB_DEBUG_TRACE: - samba_level = 5; - break; - - }; - vasprintf(&s, fmt, ap); - if (!s) return; - DEBUG(samba_level, ("ldb: %s\n", s)); - free(s); -} - - -/* - connecting to a ldb can be a relatively expensive operation because - of the schema and partition loads. We keep a list of open ldb - contexts here, and try to re-use when possible. - - This means callers of ldb_wrap_connect() must use talloc_unlink() or - the free of a parent to destroy the context - */ -static struct ldb_wrap { - struct ldb_wrap *next, *prev; - struct ldb_wrap_context { - /* the context is what we use to tell if two ldb - * connections are exactly equivalent - */ - const char *url; - struct tevent_context *ev; - struct loadparm_context *lp_ctx; - struct auth_session_info *session_info; - struct cli_credentials *credentials; - unsigned int flags; - } context; - struct ldb_context *ldb; -} *ldb_wrap_list; - -/* - see if two database opens are equivalent - */ -static bool ldb_wrap_same_context(const struct ldb_wrap_context *c1, - const struct ldb_wrap_context *c2) -{ - return (c1->ev == c2->ev && - c1->lp_ctx == c2->lp_ctx && - c1->session_info == c2->session_info && - c1->credentials == c2->credentials && - c1->flags == c2->flags && - (c1->url == c2->url || strcmp(c1->url, c2->url) == 0)); -} - -/* - free a ldb_wrap structure - */ -static int ldb_wrap_destructor(struct ldb_wrap *w) -{ - DLIST_REMOVE(ldb_wrap_list, w); - return 0; -} - -/* - wrapped connection to a ldb database - to close just talloc_free() the returned ldb_context - - TODO: We need an error_string parameter - */ -struct ldb_context *ldb_wrap_connect(TALLOC_CTX *mem_ctx, - struct tevent_context *ev, - struct loadparm_context *lp_ctx, - const char *url, - struct auth_session_info *session_info, - struct cli_credentials *credentials, - unsigned int flags) -{ - struct ldb_context *ldb; - int ret; - char *real_url = NULL; - struct ldb_wrap *w; - struct ldb_wrap_context c; - - c.url = url; - c.ev = ev; - c.lp_ctx = lp_ctx; - c.session_info = session_info; - c.credentials = credentials; - c.flags = flags; - - /* see if we can re-use an existing ldb */ - for (w=ldb_wrap_list; w; w=w->next) { - if (ldb_wrap_same_context(&c, &w->context)) { - return talloc_reference(mem_ctx, w->ldb); - } - } - - /* we want to use the existing event context if possible. This - relies on the fact that in smbd, everything is a child of - the main event_context */ - if (ev == NULL) { - return NULL; - } - - ldb = ldb_init(mem_ctx, ev); - if (ldb == NULL) { - return NULL; - } - - ldb_set_modules_dir(ldb, - talloc_asprintf(ldb, - "%s/ldb", - lp_modulesdir(lp_ctx))); - - if (ldb_set_opaque(ldb, "sessionInfo", session_info)) { - talloc_free(ldb); - return NULL; - } - - if (ldb_set_opaque(ldb, "credentials", credentials)) { - talloc_free(ldb); - return NULL; - } - - if (ldb_set_opaque(ldb, "loadparm", lp_ctx)) { - talloc_free(ldb); - return NULL; - } - - /* This must be done before we load the schema, as these - * handlers for objectSid and objectGUID etc must take - * precedence over the 'binary attribute' declaration in the - * schema */ - ret = ldb_register_samba_handlers(ldb); - if (ret == -1) { - talloc_free(ldb); - return NULL; - } - - if (lp_ctx != NULL && strcmp(lp_sam_url(lp_ctx), url) == 0) { - dsdb_set_global_schema(ldb); - } - - ldb_set_debug(ldb, ldb_wrap_debug, NULL); - - ldb_set_utf8_fns(ldb, NULL, wrap_casefold); - - real_url = private_path(ldb, lp_ctx, url); - if (real_url == NULL) { - talloc_free(ldb); - return NULL; - } - - /* allow admins to force non-sync ldb for all databases */ - if (lp_parm_bool(lp_ctx, NULL, "ldb", "nosync", false)) { - flags |= LDB_FLG_NOSYNC; - } - - if (DEBUGLVL(10)) { - flags |= LDB_FLG_ENABLE_TRACING; - } - - /* we usually want Samba databases to be private. If we later - find we need one public, we will need to add a parameter to - ldb_wrap_connect() */ - ldb_set_create_perms(ldb, 0600); - - ret = ldb_connect(ldb, real_url, flags, NULL); - if (ret != LDB_SUCCESS) { - talloc_free(ldb); - return NULL; - } - - /* setup for leak detection */ - ldb_set_opaque(ldb, "wrap_url", real_url); - - /* add to the list of open ldb contexts */ - w = talloc(ldb, struct ldb_wrap); - if (w == NULL) { - talloc_free(ldb); - return NULL; - } - - w->context = c; - w->context.url = talloc_strdup(w, url); - if (w->context.url == NULL) { - talloc_free(ldb); - return NULL; - } - - w->ldb = ldb; - - DLIST_ADD(ldb_wrap_list, w); - - /* make the resulting schema global */ - if (lp_ctx != NULL && strcmp(lp_sam_url(lp_ctx), url) == 0) { - struct dsdb_schema *schema = dsdb_get_schema(ldb, NULL); - if (schema) { - dsdb_make_schema_global(ldb, schema); - } - } - - DEBUG(3,("ldb_wrap open of %s\n", url)); - - talloc_set_destructor(w, ldb_wrap_destructor); - - return ldb; -} - -/* - when we fork() we need to make sure that any open ldb contexts have - any open transactions cancelled - */ -void ldb_wrap_fork_hook(void) -{ - struct ldb_wrap *w; - - for (w=ldb_wrap_list; w; w=w->next) { - if (ldb_transaction_cancel_noerr(w->ldb) != LDB_SUCCESS) { - smb_panic("Failed to cancel child transactions\n"); - } - } - - if (tdb_reopen_all(1) == -1) { - smb_panic("tdb_reopen_all failed\n"); - } -} - diff --git a/source4/lib/ldb_wrap.h b/source4/lib/ldb_wrap.h deleted file mode 100644 index 650f97d17d..0000000000 --- a/source4/lib/ldb_wrap.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - Unix SMB/CIFS implementation. - - database wrap headers - - Copyright (C) Andrew Tridgell 2004 - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#ifndef _LDB_WRAP_H_ -#define _LDB_WRAP_H_ - -struct auth_session_info; -struct ldb_message; -struct ldb_dn; -struct cli_credentials; -struct loadparm_context; -struct tevent_context; - -char *wrap_casefold(void *context, void *mem_ctx, const char *s, size_t n); - -struct ldb_context *ldb_wrap_connect(TALLOC_CTX *mem_ctx, - struct tevent_context *ev, - struct loadparm_context *lp_ctx, - const char *url, - struct auth_session_info *session_info, - struct cli_credentials *credentials, - unsigned int flags); - -void ldb_wrap_fork_hook(void); -#endif /* _LDB_WRAP_H_ */ diff --git a/source4/lib/registry/wscript_build b/source4/lib/registry/wscript_build index 185685cdba..de36133f05 100644 --- a/source4/lib/registry/wscript_build +++ b/source4/lib/registry/wscript_build @@ -13,7 +13,7 @@ bld.SAMBA_SUBSYSTEM('TDR_REGF', bld.SAMBA_LIBRARY('registry', source='interface.c ../../../libcli/registry/util_reg.c util.c samba.c patchfile_dotreg.c patchfile_preg.c patchfile.c regf.c hive.c local.c ldb.c dir.c rpc.c', pc_files='registry.pc', - public_deps='LIBSAMBA-UTIL CHARSET TDR_REGF ldb RPC_NDR_WINREG LDB_WRAP', + public_deps='LIBSAMBA-UTIL CHARSET TDR_REGF ldb RPC_NDR_WINREG LDBSAMBA', public_headers='registry.h', vnum='0.0.1' ) diff --git a/source4/lib/wscript_build b/source4/lib/wscript_build index 44267629d3..49da72caca 100644 --- a/source4/lib/wscript_build +++ b/source4/lib/wscript_build @@ -13,14 +13,6 @@ bld.SAMBA_SUBSYSTEM('GENCACHE', ) -bld.SAMBA_SUBSYSTEM('LDB_WRAP', - source='ldb_wrap.c', - public_deps='ldb', - public_headers='ldb_wrap.h', - deps='LDBSAMBA UTIL_LDB' - ) - - bld.SAMBA_SUBSYSTEM('TDB_WRAP', source='tdb_wrap.c', public_deps='tdb talloc', diff --git a/source4/libnet/libnet_become_dc.c b/source4/libnet/libnet_become_dc.c index 16ffb5c77d..d64e415f8c 100644 --- a/source4/libnet/libnet_become_dc.c +++ b/source4/libnet/libnet_become_dc.c @@ -23,7 +23,7 @@ #include "libcli/cldap/cldap.h" #include "lib/ldb/include/ldb.h" #include "lib/ldb/include/ldb_errors.h" -#include "lib/ldb_wrap.h" +#include "ldb_wrap.h" #include "dsdb/samdb/samdb.h" #include "../libds/common/flags.h" #include "librpc/gen_ndr/ndr_drsuapi_c.h" diff --git a/source4/libnet/libnet_unbecome_dc.c b/source4/libnet/libnet_unbecome_dc.c index 66f73d594f..a8b53df56d 100644 --- a/source4/libnet/libnet_unbecome_dc.c +++ b/source4/libnet/libnet_unbecome_dc.c @@ -23,7 +23,7 @@ #include "libcli/cldap/cldap.h" #include "lib/ldb/include/ldb.h" #include "lib/ldb/include/ldb_errors.h" -#include "lib/ldb_wrap.h" +#include "ldb_wrap.h" #include "dsdb/samdb/samdb.h" #include "../libds/common/flags.h" #include "librpc/gen_ndr/ndr_drsuapi_c.h" diff --git a/source4/libnet/libnet_vampire.c b/source4/libnet/libnet_vampire.c index 1d5489cc5a..9f1f9626bf 100644 --- a/source4/libnet/libnet_vampire.c +++ b/source4/libnet/libnet_vampire.c @@ -34,7 +34,7 @@ #include "librpc/gen_ndr/ndr_drsblobs.h" #include "librpc/gen_ndr/ndr_misc.h" #include "system/time.h" -#include "lib/ldb_wrap.h" +#include "ldb_wrap.h" #include "auth/auth.h" #include "auth/credentials/credentials.h" #include "param/param.h" diff --git a/source4/libnet/wscript_build b/source4/libnet/wscript_build index 9aa9aed5ae..5bf926b05e 100644 --- a/source4/libnet/wscript_build +++ b/source4/libnet/wscript_build @@ -3,7 +3,6 @@ bld.SAMBA_SUBSYSTEM('LIBSAMBA-NET', source='libnet.c libnet_passwd.c libnet_time.c libnet_rpc.c libnet_join.c libnet_site.c libnet_become_dc.c libnet_unbecome_dc.c libnet_vampire.c libnet_samdump.c libnet_samdump_keytab.c libnet_samsync_ldb.c libnet_user.c libnet_group.c libnet_share.c libnet_lookup.c libnet_domain.c userinfo.c groupinfo.c userman.c groupman.c prereq_domain.c libnet_samsync.c libnet_export_keytab.c', autoproto='libnet_proto.h', - deps = 'LDB_WRAP', public_deps='CREDENTIALS dcerpc dcerpc_samr RPC_NDR_LSA RPC_NDR_SRVSVC RPC_NDR_DRSUAPI LIBCLI_COMPOSITE LIBCLI_RESOLVE LIBCLI_FINDDCS LIBCLI_CLDAP LIBCLI_FINDDCS gensec_schannel LIBCLI_AUTH LIBNDR SMBPASSWD PROVISION LIBCLI_SAMSYNC HDB_SAMBA4 LIBTSOCKET' ) diff --git a/source4/param/provision.c b/source4/param/provision.c index 81c4fb16a5..0df370b4c2 100644 --- a/source4/param/provision.c +++ b/source4/param/provision.c @@ -21,7 +21,6 @@ #include #include "includes.h" #include "auth/auth.h" -#include "lib/ldb_wrap.h" #include "ldb/include/ldb.h" #include "ldb_errors.h" #include "libcli/raw/libcliraw.h" diff --git a/source4/param/wscript_build b/source4/param/wscript_build index f3729d0550..47d82f73ea 100644 --- a/source4/param/wscript_build +++ b/source4/param/wscript_build @@ -35,7 +35,7 @@ bld.SAMBA_MODULE('share_ldb', source='share_ldb.c', subsystem='share', init_function='share_ldb_init', - deps='ldb LDB_WRAP' + deps='LDBSAMBA' ) diff --git a/source4/smbd/process_onefork.c b/source4/smbd/process_onefork.c index d1688ec98a..b0e2e29bd6 100644 --- a/source4/smbd/process_onefork.c +++ b/source4/smbd/process_onefork.c @@ -31,7 +31,7 @@ #include "system/filesys.h" #include "cluster/cluster.h" #include "param/param.h" -#include "lib/ldb_wrap.h" +#include "ldb_wrap.h" #ifdef HAVE_SETPROCTITLE #ifdef HAVE_SETPROCTITLE_H diff --git a/source4/smbd/process_prefork.c b/source4/smbd/process_prefork.c index 7813189f19..fd1dc88fb1 100644 --- a/source4/smbd/process_prefork.c +++ b/source4/smbd/process_prefork.c @@ -31,7 +31,7 @@ #include "system/filesys.h" #include "cluster/cluster.h" #include "param/param.h" -#include "lib/ldb_wrap.h" +#include "ldb_wrap.h" #ifdef HAVE_SETPROCTITLE #ifdef HAVE_SETPROCTITLE_H diff --git a/source4/smbd/process_standard.c b/source4/smbd/process_standard.c index baa3136a53..6a7e8833eb 100644 --- a/source4/smbd/process_standard.c +++ b/source4/smbd/process_standard.c @@ -27,7 +27,7 @@ #include "system/filesys.h" #include "cluster/cluster.h" #include "param/param.h" -#include "lib/ldb_wrap.h" +#include "ldb_wrap.h" #ifdef HAVE_SETPROCTITLE #ifdef HAVE_SETPROCTITLE_H diff --git a/source4/smbd/wscript_build b/source4/smbd/wscript_build index 68e75ca1da..217ef95128 100644 --- a/source4/smbd/wscript_build +++ b/source4/smbd/wscript_build @@ -39,7 +39,7 @@ bld.SAMBA_MODULE('process_model_standard', source='process_standard.c', subsystem='process_model', init_function='process_model_standard_init', - deps='LIBEVENTS SETPROCTITLE' + deps='LIBEVENTS SETPROCTITLE LDBSAMBA' ) diff --git a/source4/torture/drs/unit/schemainfo_tests.c b/source4/torture/drs/unit/schemainfo_tests.c index a69e8a80cc..3958eb365b 100644 --- a/source4/torture/drs/unit/schemainfo_tests.c +++ b/source4/torture/drs/unit/schemainfo_tests.c @@ -24,7 +24,7 @@ #include "torture/smbtorture.h" #include "dsdb/samdb/samdb.h" #include "dsdb/samdb/ldb_modules/util.h" -#include "lib/ldb_wrap.h" +#include "ldb_wrap.h" #include "lib/ldb/include/ldb_module.h" #include "torture/rpc/drsuapi.h" #include "librpc/ndr/libndr.h" diff --git a/source4/torture/libnet/libnet_BecomeDC.c b/source4/torture/libnet/libnet_BecomeDC.c index 9e0ab1cb48..1d095fbf5f 100644 --- a/source4/torture/libnet/libnet_BecomeDC.c +++ b/source4/torture/libnet/libnet_BecomeDC.c @@ -28,7 +28,7 @@ #include "librpc/gen_ndr/ndr_drsuapi.h" #include "librpc/gen_ndr/ndr_drsblobs.h" #include "system/time.h" -#include "lib/ldb_wrap.h" +#include "ldb_wrap.h" #include "auth/auth.h" #include "param/param.h" #include "param/provision.h" diff --git a/source4/torture/libnet/utils.c b/source4/torture/libnet/utils.c index dcf284bb98..372482d9e8 100644 --- a/source4/torture/libnet/utils.c +++ b/source4/torture/libnet/utils.c @@ -29,7 +29,7 @@ #include "librpc/gen_ndr/ndr_samr_c.h" #include "librpc/gen_ndr/ndr_lsa_c.h" #include "torture/libnet/proto.h" -#include "lib/ldb_wrap.h" +#include "ldb_wrap.h" /** * Opens handle on Domain using SAMR diff --git a/source4/torture/local/dbspeed.c b/source4/torture/local/dbspeed.c index 1541d0ec84..dabf083bff 100644 --- a/source4/torture/local/dbspeed.c +++ b/source4/torture/local/dbspeed.c @@ -24,7 +24,7 @@ #include "../tdb/include/tdb.h" #include "lib/ldb/include/ldb.h" #include "lib/ldb/include/ldb_errors.h" -#include "lib/ldb_wrap.h" +#include "ldb_wrap.h" #include "lib/tdb_wrap.h" #include "torture/smbtorture.h" #include "param/param.h" diff --git a/source4/torture/rpc/dsgetinfo.c b/source4/torture/rpc/dsgetinfo.c index 7d210229d8..8cf3edcdd7 100644 --- a/source4/torture/rpc/dsgetinfo.c +++ b/source4/torture/rpc/dsgetinfo.c @@ -29,7 +29,6 @@ #include "auth/gensec/gensec.h" #include "param/param.h" #include "dsdb/samdb/samdb.h" -#include "lib/ldb_wrap.h" #include "torture/rpc/torture_rpc.h" #include "torture/drs/proto.h" diff --git a/source4/torture/rpc/dssync.c b/source4/torture/rpc/dssync.c index d6ed191284..49400bc105 100644 --- a/source4/torture/rpc/dssync.c +++ b/source4/torture/rpc/dssync.c @@ -30,7 +30,6 @@ #include "auth/gensec/gensec.h" #include "param/param.h" #include "dsdb/samdb/samdb.h" -#include "lib/ldb_wrap.h" #include "torture/rpc/torture_rpc.h" #include "torture/drs/proto.h" #include "lib/tsocket/tsocket.h" diff --git a/source4/torture/rpc/netlogon.c b/source4/torture/rpc/netlogon.c index 03de3bdc10..787914e46d 100644 --- a/source4/torture/rpc/netlogon.c +++ b/source4/torture/rpc/netlogon.c @@ -34,7 +34,7 @@ #include "libcli/security/security.h" #include "lib/ldb/include/ldb.h" #include "lib/util/util_ldb.h" -#include "lib/ldb_wrap.h" +#include "ldb_wrap.h" #include "lib/replace/system/network.h" #include "dsdb/samdb/samdb.h" diff --git a/source4/torture/wscript_build b/source4/torture/wscript_build index 4474e2b5f6..798e8c7d72 100644 --- a/source4/torture/wscript_build +++ b/source4/torture/wscript_build @@ -102,7 +102,7 @@ bld.SAMBA_MODULE('TORTURE_UNIX', bld.SAMBA_MODULE('TORTURE_LDAP', source='ldap/common.c ldap/basic.c ldap/schema.c ldap/uptodatevector.c ldap/cldap.c ldap/cldapbench.c ldap/ldap_sort.c ldap/nested_search.c', subsystem='smbtorture', - deps='LIBCLI_LDAP LIBCLI_CLDAP SAMDB POPT_CREDENTIALS torture LDB_WRAP', + deps='LIBCLI_LDAP LIBCLI_CLDAP SAMDB POPT_CREDENTIALS torture LDBSAMBA', internal_module=True, autoproto='ldap/proto.h', init_function='torture_ldap_init' diff --git a/source4/utils/net/drs/net_drs.c b/source4/utils/net/drs/net_drs.c index c174bf4f98..578b6f2fc3 100644 --- a/source4/utils/net/drs/net_drs.c +++ b/source4/utils/net/drs/net_drs.c @@ -24,7 +24,7 @@ #include "librpc/gen_ndr/ndr_drsuapi_c.h" #include "utils/net/drs/net_drs.h" #include "lib/ldb/include/ldb.h" -#include "lib/ldb_wrap.h" +#include "ldb_wrap.h" #include "system/filesys.h" diff --git a/source4/winbind/idmap.c b/source4/winbind/idmap.c index 9d25a6aaf4..ede2485e6a 100644 --- a/source4/winbind/idmap.c +++ b/source4/winbind/idmap.c @@ -23,7 +23,7 @@ #include "auth/auth.h" #include "librpc/gen_ndr/ndr_security.h" #include "lib/ldb/include/ldb.h" -#include "lib/ldb_wrap.h" +#include "ldb_wrap.h" #include "param/param.h" #include "winbind/idmap.h" #include "libcli/security/security.h" -- cgit