mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
Make up the right dependencies now that ldb depends on libevents
This commit is contained in:
parent
7109b6a5a1
commit
3b8eec7ca3
@ -22,6 +22,7 @@
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
#include "lib/events/events.h"
|
||||
#include "lib/ldb/include/ldb.h"
|
||||
#include "librpc/gen_ndr/samr.h" /* for struct samrPassword */
|
||||
#include "param/secrets.h"
|
||||
@ -215,7 +216,7 @@ _PUBLIC_ NTSTATUS cli_credentials_set_secrets(struct cli_credentials *cred,
|
||||
|
||||
if (!ldb) {
|
||||
/* Local secrets are stored in secrets.ldb */
|
||||
ldb = secrets_db_connect(mem_ctx, lp_ctx);
|
||||
ldb = secrets_db_connect(mem_ctx, event_ctx, lp_ctx);
|
||||
if (!ldb) {
|
||||
/* set anonymous as the fallback, if the machine account won't work */
|
||||
cli_credentials_set_anonymous(cred);
|
||||
|
@ -20,6 +20,7 @@
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
#include "lib/events/events.h"
|
||||
#include "lib/ldb/include/ldb.h"
|
||||
#include "lib/ldb/include/ldb_errors.h"
|
||||
#include "dsdb/samdb/samdb.h"
|
||||
|
@ -22,6 +22,7 @@
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
#include "events.h"
|
||||
#include "ldb.h"
|
||||
#include "ldb_errors.h"
|
||||
#include "lib/util/util_ldb.h"
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "includes.h"
|
||||
#include "librpc/gen_ndr/drsuapi.h"
|
||||
#include "rpc_server/common/common.h"
|
||||
#include "lib/events/events.h"
|
||||
#include "lib/ldb/include/ldb.h"
|
||||
#include "lib/ldb/include/ldb_errors.h"
|
||||
#include "system/kerberos.h"
|
||||
@ -358,7 +359,7 @@ WERROR DsCrackNameOneName(struct ldb_context *sam_ctx, TALLOC_CTX *mem_ctx,
|
||||
|
||||
struct smb_krb5_context *smb_krb5_context;
|
||||
ret = smb_krb5_init_context(mem_ctx,
|
||||
(struct event_context *)ldb_get_opaque(sam_ctx, "EventContext"),
|
||||
ldb_get_event_context(sam_ctx),
|
||||
(struct loadparm_context *)ldb_get_opaque(sam_ctx, "loadparm"),
|
||||
&smb_krb5_context);
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
[MODULE::ldb_objectguid]
|
||||
SUBSYSTEM = LIBLDB
|
||||
OUTPUT_TYPE = SHARED_LIBRARY
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC LIBNDR NDR_MISC
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC LIBEVENTS LIBNDR NDR_MISC
|
||||
INIT_FUNCTION = LDB_MODULE(objectguid)
|
||||
# End MODULE ldb_objectguid
|
||||
################################################
|
||||
@ -15,8 +15,9 @@ ldb_objectguid_OBJ_FILES = $(dsdbsrcdir)/samdb/ldb_modules/objectguid.o
|
||||
[MODULE::ldb_repl_meta_data]
|
||||
SUBSYSTEM = LIBLDB
|
||||
OUTPUT_TYPE = SHARED_LIBRARY
|
||||
PRIVATE_DEPENDENCIES = SAMDB LIBTALLOC LIBNDR NDR_MISC NDR_DRSUAPI \
|
||||
NDR_DRSBLOBS LIBNDR
|
||||
PRIVATE_DEPENDENCIES = SAMDB LIBTALLOC LIBEVENTS \
|
||||
LIBNDR NDR_MISC NDR_DRSUAPI \
|
||||
NDR_DRSBLOBS LIBNDR
|
||||
INIT_FUNCTION = LDB_MODULE(repl_meta_data)
|
||||
# End MODULE ldb_repl_meta_data
|
||||
################################################
|
||||
@ -29,7 +30,7 @@ ldb_repl_meta_data_OBJ_FILES = \
|
||||
[MODULE::ldb_dsdb_cache]
|
||||
SUBSYSTEM = LIBLDB
|
||||
OUTPUT_TYPE = SHARED_LIBRARY
|
||||
PRIVATE_DEPENDENCIES = SAMDB LIBTALLOC
|
||||
PRIVATE_DEPENDENCIES = SAMDB LIBTALLOC LIBEVENTS
|
||||
INIT_FUNCTION = LDB_MODULE(dsdb_cache)
|
||||
# End MODULE ldb_dsdb_cache
|
||||
################################################
|
||||
@ -42,7 +43,7 @@ ldb_dsdb_cache_OBJ_FILES = \
|
||||
[MODULE::ldb_schema_fsmo]
|
||||
SUBSYSTEM = LIBLDB
|
||||
OUTPUT_TYPE = SHARED_LIBRARY
|
||||
PRIVATE_DEPENDENCIES = SAMDB LIBTALLOC
|
||||
PRIVATE_DEPENDENCIES = SAMDB LIBTALLOC LIBEVENTS
|
||||
INIT_FUNCTION = LDB_MODULE(schema_fsmo)
|
||||
# End MODULE ldb_schema_fsmo
|
||||
################################################
|
||||
@ -55,7 +56,7 @@ ldb_schema_fsmo_OBJ_FILES = \
|
||||
[MODULE::ldb_naming_fsmo]
|
||||
SUBSYSTEM = LIBLDB
|
||||
OUTPUT_TYPE = SHARED_LIBRARY
|
||||
PRIVATE_DEPENDENCIES = SAMDB LIBTALLOC
|
||||
PRIVATE_DEPENDENCIES = SAMDB LIBTALLOC LIBEVENTS
|
||||
INIT_FUNCTION = LDB_MODULE(naming_fsmo)
|
||||
# End MODULE ldb_naming_fsmo
|
||||
################################################
|
||||
@ -68,7 +69,7 @@ ldb_naming_fsmo_OBJ_FILES = \
|
||||
[MODULE::ldb_pdc_fsmo]
|
||||
SUBSYSTEM = LIBLDB
|
||||
OUTPUT_TYPE = SHARED_LIBRARY
|
||||
PRIVATE_DEPENDENCIES = SAMDB LIBTALLOC
|
||||
PRIVATE_DEPENDENCIES = SAMDB LIBTALLOC LIBEVENTS
|
||||
INIT_FUNCTION = LDB_MODULE(pdc_fsmo)
|
||||
# End MODULE ldb_pdc_fsmo
|
||||
################################################
|
||||
@ -81,7 +82,7 @@ ldb_pdc_fsmo_OBJ_FILES = \
|
||||
[MODULE::ldb_samldb]
|
||||
SUBSYSTEM = LIBLDB
|
||||
OUTPUT_TYPE = SHARED_LIBRARY
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC LDAP_ENCODE NDR_MISC SAMDB
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC LIBEVENTS LDAP_ENCODE NDR_MISC SAMDB
|
||||
INIT_FUNCTION = LDB_MODULE(samldb)
|
||||
#
|
||||
# End MODULE ldb_samldb
|
||||
@ -96,8 +97,8 @@ ldb_samldb_OBJ_FILES = \
|
||||
SUBSYSTEM = LIBLDB
|
||||
OUTPUT_TYPE = SHARED_LIBRARY
|
||||
INIT_FUNCTION = LDB_MODULE(samba3sam)
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC SMBPASSWD NSS_WRAPPER LIBSECURITY \
|
||||
NDR_SECURITY
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC LIBEVENTS SMBPASSWD \
|
||||
NSS_WRAPPER LIBSECURITY NDR_SECURITY
|
||||
# End MODULE ldb_samldb
|
||||
################################################
|
||||
|
||||
@ -110,7 +111,7 @@ ldb_samba3sam_OBJ_FILES = \
|
||||
SUBSYSTEM = LIBLDB
|
||||
OUTPUT_TYPE = SHARED_LIBRARY
|
||||
INIT_FUNCTION = LDB_MODULE(simple_ldap_map)
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC LIBNDR NDR_MISC
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC LIBEVENTS LIBNDR NDR_MISC
|
||||
ENABLE = YES
|
||||
ALIASES = entryuuid nsuniqueid
|
||||
# End MODULE ldb_entryuuid
|
||||
@ -135,7 +136,7 @@ ldb_simple_ldap_map_OBJ_FILES = \
|
||||
# Start MODULE ldb_rootdse
|
||||
[MODULE::ldb_rootdse]
|
||||
SUBSYSTEM = LIBLDB
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC SAMDB
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC LIBEVENTS SAMDB
|
||||
OUTPUT_TYPE = SHARED_LIBRARY
|
||||
INIT_FUNCTION = LDB_MODULE(rootdse)
|
||||
# End MODULE ldb_rootdse
|
||||
@ -149,8 +150,9 @@ ldb_rootdse_OBJ_FILES = $(dsdbsrcdir)/samdb/ldb_modules/rootdse.o
|
||||
SUBSYSTEM = LIBLDB
|
||||
OUTPUT_TYPE = SHARED_LIBRARY
|
||||
INIT_FUNCTION = LDB_MODULE(password_hash)
|
||||
PRIVATE_DEPENDENCIES = HEIMDAL_HDB_KEYS LIBTALLOC HEIMDAL_KRB5 LDAP_ENCODE \
|
||||
LIBCLI_AUTH NDR_DRSBLOBS KERBEROS SAMDB
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC LIBEVENTS SAMDB LDAP_ENCODE \
|
||||
LIBCLI_AUTH NDR_DRSBLOBS KERBEROS \
|
||||
HEIMDAL_HDB_KEYS HEIMDAL_KRB5
|
||||
# End MODULE ldb_password_hash
|
||||
################################################
|
||||
|
||||
@ -159,7 +161,7 @@ ldb_password_hash_OBJ_FILES = $(dsdbsrcdir)/samdb/ldb_modules/password_hash.o
|
||||
################################################
|
||||
# Start MODULE ldb_local_password
|
||||
[MODULE::ldb_local_password]
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC LIBNDR SAMDB
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC LIBEVENTS LIBNDR SAMDB
|
||||
OUTPUT_TYPE = SHARED_LIBRARY
|
||||
SUBSYSTEM = LIBLDB
|
||||
INIT_FUNCTION = LDB_MODULE(local_password)
|
||||
@ -171,7 +173,7 @@ ldb_local_password_OBJ_FILES = $(dsdbsrcdir)/samdb/ldb_modules/local_password.o
|
||||
################################################
|
||||
# Start MODULE ldb_kludge_acl
|
||||
[MODULE::ldb_kludge_acl]
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC LIBSECURITY SAMDB
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC LIBEVENTS LIBSECURITY SAMDB
|
||||
OUTPUT_TYPE = SHARED_LIBRARY
|
||||
SUBSYSTEM = LIBLDB
|
||||
INIT_FUNCTION = LDB_MODULE(kludge_acl)
|
||||
@ -186,7 +188,7 @@ ldb_kludge_acl_OBJ_FILES = $(dsdbsrcdir)/samdb/ldb_modules/kludge_acl.o
|
||||
[MODULE::ldb_extended_dn]
|
||||
SUBSYSTEM = LIBLDB
|
||||
OUTPUT_TYPE = SHARED_LIBRARY
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC LIBNDR LIBSECURITY SAMDB
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC LIBEVENTS LIBNDR LIBSECURITY SAMDB
|
||||
INIT_FUNCTION = LDB_MODULE(extended_dn)
|
||||
# End MODULE ldb_extended_dn
|
||||
################################################
|
||||
@ -198,7 +200,7 @@ ldb_extended_dn_OBJ_FILES = $(dsdbsrcdir)/samdb/ldb_modules/extended_dn.o
|
||||
[MODULE::ldb_show_deleted]
|
||||
SUBSYSTEM = LIBLDB
|
||||
OUTPUT_TYPE = SHARED_LIBRARY
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC LIBEVENTS
|
||||
INIT_FUNCTION = LDB_MODULE(show_deleted)
|
||||
# End MODULE ldb_show_deleted
|
||||
################################################
|
||||
@ -210,7 +212,7 @@ ldb_show_deleted_OBJ_FILES = $(dsdbsrcdir)/samdb/ldb_modules/show_deleted.o
|
||||
[MODULE::ldb_partition]
|
||||
SUBSYSTEM = LIBLDB
|
||||
OUTPUT_TYPE = SHARED_LIBRARY
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC SAMDB
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC LIBEVENTS SAMDB
|
||||
INIT_FUNCTION = LDB_MODULE(partition)
|
||||
# End MODULE ldb_partition
|
||||
################################################
|
||||
@ -222,7 +224,7 @@ ldb_partition_OBJ_FILES = $(dsdbsrcdir)/samdb/ldb_modules/partition.o
|
||||
[MODULE::ldb_schema]
|
||||
SUBSYSTEM = LIBLDB
|
||||
OUTPUT_TYPE = SHARED_LIBRARY
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC LIBLDB
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC LIBEVENTS LIBLDB
|
||||
INIT_FUNCTION = LDB_MODULE(schema)
|
||||
# End MODULE ldb_schema
|
||||
################################################
|
||||
@ -234,7 +236,7 @@ ldb_schema_OBJ_FILES = $(addprefix $(dsdbsrcdir)/samdb/ldb_modules/, schema.o sc
|
||||
[MODULE::ldb_update_keytab]
|
||||
SUBSYSTEM = LIBLDB
|
||||
OUTPUT_TYPE = SHARED_LIBRARY
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC CREDENTIALS
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC LIBEVENTS CREDENTIALS
|
||||
#Also depends on credentials, but that would loop
|
||||
INIT_FUNCTION = LDB_MODULE(update_kt)
|
||||
# End MODULE ldb_update_kt
|
||||
@ -248,7 +250,7 @@ ldb_update_keytab_OBJ_FILES = $(dsdbsrcdir)/samdb/ldb_modules/update_keytab.o
|
||||
INIT_FUNCTION = LDB_MODULE(objectclass)
|
||||
OUTPUT_TYPE = SHARED_LIBRARY
|
||||
CFLAGS = -Ilib/ldb/include
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC LIBSECURITY NDR_SECURITY SAMDB
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC LIBEVENTS LIBSECURITY NDR_SECURITY SAMDB
|
||||
SUBSYSTEM = LIBLDB
|
||||
# End MODULE ldb_objectclass
|
||||
################################################
|
||||
@ -260,7 +262,7 @@ ldb_objectclass_OBJ_FILES = $(dsdbsrcdir)/samdb/ldb_modules/objectclass.o
|
||||
[MODULE::ldb_subtree_rename]
|
||||
INIT_FUNCTION = LDB_MODULE(subtree_rename)
|
||||
CFLAGS = -Ilib/ldb/include
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC LIBEVENTS
|
||||
SUBSYSTEM = LIBLDB
|
||||
# End MODULE ldb_subtree_rename
|
||||
################################################
|
||||
@ -272,7 +274,7 @@ ldb_subtree_rename_OBJ_FILES = $(dsdbsrcdir)/samdb/ldb_modules/subtree_rename.o
|
||||
[MODULE::ldb_subtree_delete]
|
||||
INIT_FUNCTION = LDB_MODULE(subtree_delete)
|
||||
CFLAGS = -Ilib/ldb/include
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC LIBEVENTS
|
||||
SUBSYSTEM = LIBLDB
|
||||
# End MODULE ldb_subtree_rename
|
||||
################################################
|
||||
@ -285,7 +287,7 @@ ldb_subtree_delete_OBJ_FILES = $(dsdbsrcdir)/samdb/ldb_modules/subtree_delete.o
|
||||
INIT_FUNCTION = LDB_MODULE(linked_attributes)
|
||||
CFLAGS = -Ilib/ldb/include
|
||||
OUTPUT_TYPE = SHARED_LIBRARY
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC SAMDB
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC LIBEVENTS SAMDB
|
||||
SUBSYSTEM = LIBLDB
|
||||
# End MODULE ldb_linked_attributes
|
||||
################################################
|
||||
@ -297,7 +299,7 @@ ldb_linked_attributes_OBJ_FILES = $(dsdbsrcdir)/samdb/ldb_modules/linked_attribu
|
||||
[MODULE::ldb_ranged_results]
|
||||
INIT_FUNCTION = LDB_MODULE(ranged_results)
|
||||
CFLAGS = -Ilib/ldb/include
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC LIBEVENTS
|
||||
SUBSYSTEM = LIBLDB
|
||||
# End MODULE ldb_ranged_results
|
||||
################################################
|
||||
@ -310,7 +312,7 @@ ldb_ranged_results_OBJ_FILES = $(dsdbsrcdir)/samdb/ldb_modules/ranged_results.o
|
||||
INIT_FUNCTION = LDB_MODULE(anr)
|
||||
CFLAGS = -Ilib/ldb/include
|
||||
OUTPUT_TYPE = SHARED_LIBRARY
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC LIBSAMBA-UTIL SAMDB
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC LIBEVENTS LIBSAMBA-UTIL SAMDB
|
||||
SUBSYSTEM = LIBLDB
|
||||
# End MODULE ldb_anr
|
||||
################################################
|
||||
@ -323,7 +325,7 @@ ldb_anr_OBJ_FILES = $(dsdbsrcdir)/samdb/ldb_modules/anr.o
|
||||
INIT_FUNCTION = LDB_MODULE(normalise)
|
||||
CFLAGS = -Ilib/ldb/include
|
||||
OUTPUT_TYPE = SHARED_LIBRARY
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC LIBSAMBA-UTIL SAMDB
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC LIBEVENTS LIBSAMBA-UTIL SAMDB
|
||||
SUBSYSTEM = LIBLDB
|
||||
# End MODULE ldb_normalise
|
||||
################################################
|
||||
@ -336,7 +338,7 @@ ldb_normalise_OBJ_FILES = $(dsdbsrcdir)/samdb/ldb_modules/normalise.o
|
||||
INIT_FUNCTION = LDB_MODULE(instancetype)
|
||||
CFLAGS = -Ilib/ldb/include
|
||||
OUTPUT_TYPE = SHARED_LIBRARY
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC LIBSAMBA-UTIL SAMDB
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC LIBEVENTS LIBSAMBA-UTIL SAMDB
|
||||
SUBSYSTEM = LIBLDB
|
||||
# End MODULE ldb_instancetype
|
||||
################################################
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "librpc/gen_ndr/ndr_netlogon.h"
|
||||
#include "librpc/gen_ndr/ndr_misc.h"
|
||||
#include "librpc/gen_ndr/ndr_security.h"
|
||||
#include "lib/events/events.h"
|
||||
#include "lib/ldb/include/ldb.h"
|
||||
#include "lib/ldb/include/ldb_errors.h"
|
||||
#include "libcli/security/security.h"
|
||||
@ -114,7 +115,7 @@ int samdb_copy_template(struct ldb_context *ldb,
|
||||
return LDB_ERR_OPERATIONS_ERROR;
|
||||
}
|
||||
|
||||
event_ctx = (struct event_context *)ldb_get_opaque(ldb, "EventContext");
|
||||
event_ctx = ldb_get_event_context(ldb);
|
||||
lp_ctx = (struct loadparm_context *)ldb_get_opaque(ldb, "loadparm");
|
||||
|
||||
/* FIXME: need to remove this wehn we finally pass the event
|
||||
|
@ -4,6 +4,7 @@ rm -rf autom4te.cache
|
||||
rm -f configure config.h.in
|
||||
|
||||
IPATHS="-I libreplace -I lib/replace -I ../libreplace -I ../replace"
|
||||
IPATHS="$IPATHS -I lib/events -I events -I ../events"
|
||||
IPATHS="$IPATHS -I lib/talloc -I talloc -I ../talloc"
|
||||
IPATHS="$IPATHS -I lib/tdb -I tdb -I ../tdb"
|
||||
IPATHS="$IPATHS -I lib/popt -I popt -I ../popt"
|
||||
|
@ -1,13 +1,13 @@
|
||||
/*
|
||||
/*
|
||||
ldb database library
|
||||
|
||||
Copyright (C) Andrew Tridgell 2004
|
||||
Copyright (C) Simo Sorce 2005-2006
|
||||
Copyright (C) Simo Sorce 2005-2008
|
||||
|
||||
** NOTE! The following LGPL license applies to the ldb
|
||||
** library. This does NOT imply that all of Samba is released
|
||||
** under the LGPL
|
||||
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
@ -34,15 +34,21 @@
|
||||
|
||||
#include "ldb_includes.h"
|
||||
|
||||
/*
|
||||
/*
|
||||
initialise a ldb context
|
||||
The mem_ctx is optional
|
||||
The mem_ctx is required
|
||||
The event_ctx is required
|
||||
*/
|
||||
struct ldb_context *ldb_init(void *mem_ctx)
|
||||
struct ldb_context *ldb_init(TALLOC_CTX *mem_ctx, struct event_context *ev_ctx)
|
||||
{
|
||||
struct ldb_context *ldb = talloc_zero(mem_ctx, struct ldb_context);
|
||||
struct ldb_context *ldb;
|
||||
int ret;
|
||||
|
||||
ldb = talloc_zero(mem_ctx, struct ldb_context);
|
||||
if (ev_ctx == NULL) {
|
||||
ev_ctx = event_context_init(ldb);
|
||||
}
|
||||
|
||||
ret = ldb_setup_wellknown_attributes(ldb);
|
||||
if (ret != 0) {
|
||||
talloc_free(ldb);
|
||||
@ -52,6 +58,10 @@ struct ldb_context *ldb_init(void *mem_ctx)
|
||||
ldb_set_utf8_default(ldb);
|
||||
ldb_set_create_perms(ldb, 0666);
|
||||
ldb_set_modules_dir(ldb, LDB_MODULESDIR);
|
||||
ldb_set_event_context(ldb, ev_ctx);
|
||||
|
||||
/* TODO: get timeout from options if available there */
|
||||
ldb->default_timeout = 300; /* set default to 5 minutes */
|
||||
|
||||
return ldb;
|
||||
}
|
||||
@ -568,6 +578,16 @@ void ldb_set_create_perms(struct ldb_context *ldb, unsigned int perms)
|
||||
ldb->create_perms = perms;
|
||||
}
|
||||
|
||||
void ldb_set_event_context(struct ldb_context *ldb, struct event_context *ev)
|
||||
{
|
||||
ldb->ev_ctx = ev;
|
||||
}
|
||||
|
||||
struct event_context * ldb_get_event_context(struct ldb_context *ldb)
|
||||
{
|
||||
return ldb->ev_ctx;
|
||||
}
|
||||
|
||||
/*
|
||||
start an ldb request
|
||||
NOTE: the request must be a talloc context.
|
||||
|
@ -1,7 +1,7 @@
|
||||
################################################
|
||||
# Start MODULE ldb_asq
|
||||
[MODULE::ldb_asq]
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC LIBEVENTS
|
||||
CFLAGS = -I$(ldbdir)/include
|
||||
INIT_FUNCTION = LDB_MODULE(asq)
|
||||
SUBSYSTEM = LIBLDB
|
||||
@ -13,7 +13,7 @@ ldb_asq_OBJ_FILES = $(ldbdir)/modules/asq.o
|
||||
################################################
|
||||
# Start MODULE ldb_server_sort
|
||||
[MODULE::ldb_server_sort]
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC LIBEVENTS
|
||||
CFLAGS = -I$(ldbdir)/include
|
||||
INIT_FUNCTION = LDB_MODULE(server_sort)
|
||||
SUBSYSTEM = LIBLDB
|
||||
@ -27,7 +27,7 @@ ldb_server_sort_OBJ_FILES = $(ldbdir)/modules/sort.o
|
||||
[MODULE::ldb_paged_results]
|
||||
INIT_FUNCTION = LDB_MODULE(paged_results)
|
||||
CFLAGS = -I$(ldbdir)/include
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC LIBEVENTS
|
||||
SUBSYSTEM = LIBLDB
|
||||
# End MODULE ldb_paged_results
|
||||
################################################
|
||||
@ -39,7 +39,7 @@ ldb_paged_results_OBJ_FILES = $(ldbdir)/modules/paged_results.o
|
||||
[MODULE::ldb_paged_searches]
|
||||
INIT_FUNCTION = LDB_MODULE(paged_searches)
|
||||
CFLAGS = -I$(ldbdir)/include
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC LIBEVENTS
|
||||
SUBSYSTEM = LIBLDB
|
||||
# End MODULE ldb_paged_results
|
||||
################################################
|
||||
@ -51,7 +51,7 @@ ldb_paged_searches_OBJ_FILES = $(ldbdir)/modules/paged_searches.o
|
||||
[MODULE::ldb_operational]
|
||||
SUBSYSTEM = LIBLDB
|
||||
CFLAGS = -I$(ldbdir)/include
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC LIBEVENTS
|
||||
INIT_FUNCTION = LDB_MODULE(operational)
|
||||
# End MODULE ldb_operational
|
||||
################################################
|
||||
@ -63,7 +63,7 @@ ldb_operational_OBJ_FILES = $(ldbdir)/modules/operational.o
|
||||
[MODULE::ldb_rdn_name]
|
||||
SUBSYSTEM = LIBLDB
|
||||
CFLAGS = -I$(ldbdir)/include
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC LIBEVENTS
|
||||
INIT_FUNCTION = LDB_MODULE(rdn_name)
|
||||
# End MODULE ldb_rdn_name
|
||||
################################################
|
||||
@ -79,7 +79,7 @@ $(ldb_map_OBJ_FILES): CFLAGS+=-I$(ldbdir)/ldb_map
|
||||
[MODULE::ldb_skel]
|
||||
SUBSYSTEM = LIBLDB
|
||||
CFLAGS = -I$(ldbdir)/include
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC LIBEVENTS
|
||||
INIT_FUNCTION = LDB_MODULE(skel)
|
||||
# End MODULE ldb_skel
|
||||
################################################
|
||||
@ -91,7 +91,7 @@ ldb_skel_OBJ_FILES = $(ldbdir)/modules/skel.o
|
||||
[MODULE::ldb_sqlite3]
|
||||
SUBSYSTEM = LIBLDB
|
||||
CFLAGS = -I$(ldbdir)/include
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC SQLITE3 LIBTALLOC
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC SQLITE3 LIBEVENTS
|
||||
# End MODULE ldb_sqlite3
|
||||
################################################
|
||||
|
||||
@ -103,7 +103,7 @@ ldb_sqlite3_OBJ_FILES = $(ldbdir)/ldb_sqlite3/ldb_sqlite3.o
|
||||
SUBSYSTEM = LIBLDB
|
||||
CFLAGS = -I$(ldbdir)/include -I$(ldbdir)/ldb_tdb
|
||||
PRIVATE_DEPENDENCIES = \
|
||||
LIBTDB LIBTALLOC
|
||||
LIBTDB LIBTALLOC LIBEVENTS
|
||||
# End MODULE ldb_tdb
|
||||
################################################
|
||||
|
||||
@ -116,7 +116,7 @@ ldb_tdb_OBJ_FILES = $(addprefix $(ldbdir)/ldb_tdb/, ldb_tdb.o ldb_search.o ldb_p
|
||||
CFLAGS = -I$(ldbdir)/include
|
||||
INIT_FUNCTION_TYPE = extern const struct ldb_module_ops
|
||||
PUBLIC_DEPENDENCIES = \
|
||||
LIBTALLOC
|
||||
LIBTALLOC LIBEVENTS
|
||||
PRIVATE_DEPENDENCIES = \
|
||||
SOCKET_WRAPPER
|
||||
|
||||
|
@ -46,6 +46,7 @@ EXTRA_OBJ=""
|
||||
m4_include(libpopt.m4)
|
||||
m4_include(libtalloc.m4)
|
||||
m4_include(libtdb.m4)
|
||||
m4_include(libevents.m4)
|
||||
|
||||
m4_include(ldap.m4)
|
||||
if test x"$with_ldap_support" = x"yes"; then
|
||||
|
@ -67,7 +67,7 @@ int main(int argc, const char **argv)
|
||||
Note that you can use the context structure as a parent
|
||||
for talloc allocations as well
|
||||
*/
|
||||
ldb = ldb_init(NULL);
|
||||
ldb = ldb_init(NULL, NULL);
|
||||
|
||||
/*
|
||||
We now open the database. In this example we just hard code the connection path.
|
||||
|
@ -71,7 +71,7 @@ int main(int argc, const char **argv)
|
||||
Note that you can use the context structure as a parent
|
||||
for talloc allocations as well
|
||||
*/
|
||||
ldb = ldb_init(NULL);
|
||||
ldb = ldb_init(NULL, NULL);
|
||||
|
||||
fileStream = fopen(argv[1], "r");
|
||||
if (0 == fileStream) {
|
||||
|
@ -782,6 +782,8 @@ int ldb_set_timeout(struct ldb_context *ldb, struct ldb_request *req, int timeou
|
||||
int ldb_set_timeout_from_prev_req(struct ldb_context *ldb, struct ldb_request *oldreq, struct ldb_request *newreq);
|
||||
void ldb_set_create_perms(struct ldb_context *ldb, unsigned int perms);
|
||||
void ldb_set_modules_dir(struct ldb_context *ldb, const char *path);
|
||||
void ldb_set_event_context(struct ldb_context *ldb, struct event_context *ev);
|
||||
struct event_context * ldb_get_event_context(struct ldb_context *ldb);
|
||||
|
||||
/**
|
||||
Initialise ldbs' global information
|
||||
@ -803,7 +805,7 @@ int ldb_global_init(void);
|
||||
\return pointer to ldb_context that should be free'd (using talloc_free())
|
||||
at the end of the program.
|
||||
*/
|
||||
struct ldb_context *ldb_init(TALLOC_CTX *mem_ctx);
|
||||
struct ldb_context *ldb_init(TALLOC_CTX *mem_ctx, struct event_context *ev_ctx);
|
||||
|
||||
/**
|
||||
Connect to a database.
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "system/filesys.h"
|
||||
#include "system/time.h"
|
||||
#include "talloc.h"
|
||||
#include "events.h"
|
||||
#include "ldb.h"
|
||||
#include "ldb_errors.h"
|
||||
#include "ldb_private.h"
|
||||
|
@ -133,6 +133,8 @@ struct ldb_context {
|
||||
unsigned int create_perms;
|
||||
|
||||
char *modules_dir;
|
||||
|
||||
struct event_context *ev_ctx;
|
||||
};
|
||||
|
||||
#ifndef ARRAY_SIZE
|
||||
|
@ -8,7 +8,7 @@ Name: ldb
|
||||
Description: An LDAP-like embedded database
|
||||
Version: @PACKAGE_VERSION@
|
||||
Requires.private: tdb
|
||||
Requires: talloc
|
||||
Requires: talloc events
|
||||
Libs: -L${libdir} -lldb
|
||||
Libs.private: @LDAP_LIBS@
|
||||
Cflags: -I${includedir}
|
||||
|
@ -2546,6 +2546,7 @@ static swig_module_info swig_module = {swig_types, 24, 0, 0, 0, 0};
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "talloc.h"
|
||||
#include "events.h"
|
||||
#include "ldb.h"
|
||||
#include "ldb_errors.h"
|
||||
#include "ldb_private.h"
|
||||
@ -3066,7 +3067,7 @@ static void py_ldb_debug(void *context, enum ldb_debug_level level, const char *
|
||||
|
||||
PyObject *PyExc_LdbError;
|
||||
|
||||
SWIGINTERN ldb *new_ldb(){ return ldb_init(NULL); }
|
||||
SWIGINTERN ldb *new_ldb(){ return ldb_init(NULL, NULL); }
|
||||
|
||||
SWIGINTERN int
|
||||
SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val)
|
||||
|
@ -45,7 +45,7 @@ NSS_STATUS _ldb_nss_init(void)
|
||||
|
||||
_ldb_nss_ctx->pid = mypid;
|
||||
|
||||
_ldb_nss_ctx->ldb = ldb_init(_ldb_nss_ctx);
|
||||
_ldb_nss_ctx->ldb = ldb_init(_ldb_nss_ctx, NULL);
|
||||
if (_ldb_nss_ctx->ldb == NULL) {
|
||||
goto failed;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
[PYTHON::swig_ldb]
|
||||
LIBRARY_REALNAME = _ldb.$(SHLIBEXT)
|
||||
PUBLIC_DEPENDENCIES = LIBLDB
|
||||
PUBLIC_DEPENDENCIES = LIBLDB LIBEVENTS
|
||||
|
||||
swig_ldb_OBJ_FILES = $(ldbsrcdir)/ldb_wrap.o
|
||||
$(swig_ldb_OBJ_FILES): CFLAGS+=-I$(ldbsrcdir)/include
|
||||
|
@ -9,6 +9,9 @@ make clean
|
||||
cd ../tdb
|
||||
make clean
|
||||
|
||||
cd ../events
|
||||
make clean
|
||||
|
||||
cd ../ldb
|
||||
make clean
|
||||
|
||||
|
@ -657,7 +657,7 @@ static struct schema_conv process_convert(struct ldb_context *ldb, enum convert_
|
||||
enum convert_target target;
|
||||
|
||||
ctx = talloc_new(NULL);
|
||||
ldb = ldb_init(ctx);
|
||||
ldb = ldb_init(ctx, NULL);
|
||||
|
||||
options = ldb_cmdline_process(ldb, argc, argv, usage);
|
||||
|
||||
|
@ -88,7 +88,7 @@ int main(int argc, const char **argv)
|
||||
int i, ret=0, count=0;
|
||||
struct ldb_cmdline *options;
|
||||
|
||||
ldb = ldb_init(NULL);
|
||||
ldb = ldb_init(NULL, NULL);
|
||||
|
||||
options = ldb_cmdline_process(ldb, argc, argv, usage);
|
||||
|
||||
|
@ -77,7 +77,7 @@ int main(int argc, const char **argv)
|
||||
int ret = 0, i;
|
||||
struct ldb_cmdline *options;
|
||||
|
||||
ldb = ldb_init(NULL);
|
||||
ldb = ldb_init(NULL, NULL);
|
||||
|
||||
options = ldb_cmdline_process(ldb, argc, argv, usage);
|
||||
|
||||
|
@ -279,7 +279,7 @@ int main(int argc, const char **argv)
|
||||
const char *expression = "(|(objectClass=*)(distinguishedName=*))";
|
||||
const char * const * attrs = NULL;
|
||||
|
||||
ldb = ldb_init(NULL);
|
||||
ldb = ldb_init(NULL, NULL);
|
||||
|
||||
options = ldb_cmdline_process(ldb, argc, argv, usage);
|
||||
|
||||
|
@ -89,7 +89,7 @@ int main(int argc, const char **argv)
|
||||
int i, ret=LDB_SUCCESS;
|
||||
struct ldb_cmdline *options;
|
||||
|
||||
ldb = ldb_init(NULL);
|
||||
ldb = ldb_init(NULL, NULL);
|
||||
|
||||
options = ldb_cmdline_process(ldb, argc, argv, usage);
|
||||
|
||||
|
@ -56,7 +56,7 @@ int main(int argc, const char **argv)
|
||||
struct ldb_cmdline *options;
|
||||
struct ldb_dn *dn1, *dn2;
|
||||
|
||||
ldb = ldb_init(NULL);
|
||||
ldb = ldb_init(NULL, NULL);
|
||||
|
||||
options = ldb_cmdline_process(ldb, argc, argv, usage);
|
||||
|
||||
|
@ -276,7 +276,10 @@ int main(int argc, const char **argv)
|
||||
int ret = -1;
|
||||
const char *expression = "(|(objectClass=*)(distinguishedName=*))";
|
||||
|
||||
ldb = ldb_init(NULL);
|
||||
ldb = ldb_init(NULL, NULL);
|
||||
if (ldb == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
options = ldb_cmdline_process(ldb, argc, argv, usage);
|
||||
|
||||
|
@ -344,7 +344,7 @@ static void start_test_index(struct ldb_context **ldb)
|
||||
exit(1);
|
||||
}
|
||||
|
||||
(*ldb) = ldb_init(options);
|
||||
(*ldb) = ldb_init(options, NULL);
|
||||
|
||||
ret = ldb_connect(*ldb, options->url, flags, NULL);
|
||||
if (ret != 0) {
|
||||
@ -393,7 +393,7 @@ int main(int argc, const char **argv)
|
||||
TALLOC_CTX *mem_ctx = talloc_new(NULL);
|
||||
struct ldb_context *ldb;
|
||||
|
||||
ldb = ldb_init(mem_ctx);
|
||||
ldb = ldb_init(mem_ctx, NULL);
|
||||
|
||||
options = ldb_cmdline_process(ldb, argc, argv, usage);
|
||||
|
||||
|
@ -561,7 +561,7 @@ static void usage(void)
|
||||
FILE *in = stdin;
|
||||
FILE *out = stdout;
|
||||
ctx = talloc_new(NULL);
|
||||
ldb_ctx = ldb_init(ctx);
|
||||
ldb_ctx = ldb_init(ctx, NULL);
|
||||
|
||||
setenv("LDB_URL", "NONE", 1);
|
||||
options = ldb_cmdline_process(ldb_ctx, argc, argv, usage);
|
||||
|
@ -107,22 +107,31 @@ struct ldb_context *ldb_wrap_connect(TALLOC_CTX *mem_ctx,
|
||||
char *real_url = NULL;
|
||||
size_t *startup_blocks;
|
||||
|
||||
ldb = ldb_init(mem_ctx);
|
||||
if (ldb == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ldb_set_modules_dir(ldb,
|
||||
talloc_asprintf(ldb, "%s/ldb", lp_modulesdir(lp_ctx)));
|
||||
|
||||
/* 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;
|
||||
}
|
||||
|
||||
if (ldb_set_opaque(ldb, "EventContext", ev)) {
|
||||
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 0
|
||||
if (ev) {
|
||||
ldb_event_sys_op_init(ldb, ev);
|
||||
} else {
|
||||
talloc_free(ldb);
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (ldb_set_opaque(ldb, "sessionInfo", session_info)) {
|
||||
talloc_free(ldb);
|
||||
|
@ -21,6 +21,7 @@
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
#include "lib/events/events.h"
|
||||
#include "lib/ldb/include/ldb.h"
|
||||
#include "lib/ldb/include/ldb_errors.h"
|
||||
#include "lib/util/util_ldb.h"
|
||||
|
@ -21,6 +21,7 @@
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
#include "lib/events/events.h"
|
||||
#include "libcli/ldap/ldap.h"
|
||||
#include "librpc/gen_ndr/ndr_security.h"
|
||||
#include "librpc/gen_ndr/ndr_misc.h"
|
||||
|
@ -20,6 +20,7 @@
|
||||
/* NT error codes. please read nterr.h */
|
||||
|
||||
#include "includes.h"
|
||||
#include "lib/events/events.h"
|
||||
#include "libcli/ldap/ldap.h"
|
||||
|
||||
typedef struct
|
||||
|
@ -865,7 +865,7 @@ NTSTATUS libnet_set_join_secrets(struct libnet_context *ctx,
|
||||
}
|
||||
|
||||
/* Open the secrets database */
|
||||
ldb = secrets_db_connect(tmp_mem, ctx->lp_ctx);
|
||||
ldb = secrets_db_connect(tmp_mem, ctx->event_ctx, ctx->lp_ctx);
|
||||
if (!ldb) {
|
||||
r->out.error_string
|
||||
= talloc_asprintf(mem_ctx,
|
||||
|
@ -85,7 +85,9 @@ struct tdb_wrap *secrets_init(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_c
|
||||
/**
|
||||
connect to the secrets ldb
|
||||
*/
|
||||
struct ldb_context *secrets_db_connect(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx)
|
||||
struct ldb_context *secrets_db_connect(TALLOC_CTX *mem_ctx,
|
||||
struct event_context *ev_ctx,
|
||||
struct loadparm_context *lp_ctx)
|
||||
{
|
||||
char *path;
|
||||
const char *url;
|
||||
@ -103,7 +105,7 @@ struct ldb_context *secrets_db_connect(TALLOC_CTX *mem_ctx, struct loadparm_cont
|
||||
|
||||
/* Secrets.ldb *must* always be local. If we call for a
|
||||
* system_session() we will recurse */
|
||||
ldb = ldb_init(mem_ctx);
|
||||
ldb = ldb_init(mem_ctx, ev_ctx);
|
||||
if (!ldb) {
|
||||
talloc_free(path);
|
||||
return NULL;
|
||||
@ -127,6 +129,7 @@ struct ldb_context *secrets_db_connect(TALLOC_CTX *mem_ctx, struct loadparm_cont
|
||||
* @return pointer to a SID object if the SID could be obtained, NULL otherwise
|
||||
*/
|
||||
struct dom_sid *secrets_get_domain_sid(TALLOC_CTX *mem_ctx,
|
||||
struct event_context *ev_ctx,
|
||||
struct loadparm_context *lp_ctx,
|
||||
const char *domain)
|
||||
{
|
||||
@ -138,7 +141,7 @@ struct dom_sid *secrets_get_domain_sid(TALLOC_CTX *mem_ctx,
|
||||
const struct ldb_val *v;
|
||||
enum ndr_err_code ndr_err;
|
||||
|
||||
ldb = secrets_db_connect(mem_ctx, lp_ctx);
|
||||
ldb = secrets_db_connect(mem_ctx, ev_ctx, lp_ctx);
|
||||
if (ldb == NULL) {
|
||||
DEBUG(5, ("secrets_db_connect failed\n"));
|
||||
return NULL;
|
||||
|
@ -43,9 +43,10 @@ struct machine_acct_pass {
|
||||
* @note Not called by systems with a working /dev/urandom.
|
||||
*/
|
||||
struct loadparm_context;
|
||||
struct event_context;
|
||||
struct tdb_wrap *secrets_init(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx);
|
||||
struct ldb_context *secrets_db_connect(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx);
|
||||
struct dom_sid *secrets_get_domain_sid(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx, const char *domain);
|
||||
struct ldb_context *secrets_db_connect(TALLOC_CTX *mem_ctx, struct event_context *ev_ctx, struct loadparm_context *lp_ctx);
|
||||
struct dom_sid *secrets_get_domain_sid(TALLOC_CTX *mem_ctx, struct event_context *ev_ctx, struct loadparm_context *lp_ctx, const char *domain);
|
||||
|
||||
|
||||
#endif /* _SECRETS_H */
|
||||
|
@ -1757,7 +1757,7 @@ static NTSTATUS dcesrv_lsa_CreateSecret(struct dcesrv_call_state *dce_call, TALL
|
||||
}
|
||||
|
||||
secret_state->sam_ldb = talloc_reference(secret_state,
|
||||
secrets_db_connect(mem_ctx, dce_call->conn->dce_ctx->lp_ctx));
|
||||
secrets_db_connect(mem_ctx, dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx));
|
||||
/* search for the secret record */
|
||||
ret = gendb_search(secret_state->sam_ldb, mem_ctx,
|
||||
ldb_dn_new(mem_ctx, secret_state->sam_ldb, "cn=LSA Secrets"),
|
||||
@ -1887,7 +1887,7 @@ static NTSTATUS dcesrv_lsa_OpenSecret(struct dcesrv_call_state *dce_call, TALLOC
|
||||
} else {
|
||||
secret_state->global = false;
|
||||
secret_state->sam_ldb = talloc_reference(secret_state,
|
||||
secrets_db_connect(mem_ctx, dce_call->conn->dce_ctx->lp_ctx));
|
||||
secrets_db_connect(mem_ctx, dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx));
|
||||
|
||||
name = r->in.name.string;
|
||||
if (strlen(name) < 1) {
|
||||
|
@ -256,7 +256,7 @@ static void cldap_dump_results(struct cldap_search *search)
|
||||
}
|
||||
|
||||
/* we need a ldb context to use ldb_ldif_write_file() */
|
||||
ldb = ldb_init(NULL);
|
||||
ldb = ldb_init(NULL, NULL);
|
||||
|
||||
ZERO_STRUCT(ldif);
|
||||
ldif.msg = ldap_msg_to_ldb(ldb, ldb, search->out.response);
|
||||
|
@ -593,7 +593,7 @@ bool torture_net_become_dc(struct torture_context *torture)
|
||||
s->ctx = libnet_context_init(torture->ev, torture->lp_ctx);
|
||||
s->ctx->cred = cmdline_credentials;
|
||||
|
||||
s->ldb = ldb_init(s);
|
||||
s->ldb = ldb_init(s, torture->ev);
|
||||
|
||||
ZERO_STRUCT(b);
|
||||
b.in.domain_dns_name = torture_join_dom_dns_name(s->tj);
|
||||
@ -691,7 +691,7 @@ cleanup:
|
||||
}
|
||||
|
||||
/* Leave domain. */
|
||||
torture_leave_domain(s->tj);
|
||||
torture_leave_domain(torture, s->tj);
|
||||
|
||||
talloc_free(s);
|
||||
return ret;
|
||||
|
@ -413,7 +413,7 @@ static bool nbt_test_netlogon2(struct torture_context *tctx)
|
||||
|
||||
torture_assert_int_equal(tctx, response->samlogon.nt5_ex.command, LOGON_SAM_LOGON_USER_UNKNOWN, "Got incorrect netlogon response command");
|
||||
|
||||
torture_leave_domain(join_ctx);
|
||||
torture_leave_domain(tctx, join_ctx);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -604,7 +604,7 @@ static bool nbt_test_ntlogon(struct torture_context *tctx)
|
||||
torture_assert_int_equal(tctx, response->response_type, NETLOGON_GET_PDC, "Got incorrect type of ntlogon response");
|
||||
torture_assert_int_equal(tctx, response->get_pdc.command, NETLOGON_RESPONSE_FROM_PDC, "Got incorrect ntlogon response command");
|
||||
|
||||
torture_leave_domain(join_ctx);
|
||||
torture_leave_domain(tctx, join_ctx);
|
||||
|
||||
/* setup (another) temporary mailslot listener for replies */
|
||||
dgmslot = dgram_mailslot_temp(dgmsock, NBT_MAILSLOT_GETDC,
|
||||
|
@ -709,7 +709,7 @@ bool torture_rpc_drsuapi(struct torture_context *torture)
|
||||
&p,
|
||||
&ndr_table_drsuapi);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
torture_leave_domain(priv.join);
|
||||
torture_leave_domain(torture, priv.join);
|
||||
torture_fail(torture, "Unable to connect to DRSUAPI pipe");
|
||||
}
|
||||
|
||||
@ -733,7 +733,7 @@ bool torture_rpc_drsuapi(struct torture_context *torture)
|
||||
|
||||
ret &= test_DsUnbind(p, torture, &priv);
|
||||
|
||||
torture_leave_domain(priv.join);
|
||||
torture_leave_domain(torture, priv.join);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -761,7 +761,7 @@ bool torture_rpc_drsuapi_cracknames(struct torture_context *torture)
|
||||
&p,
|
||||
&ndr_table_drsuapi);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
torture_leave_domain(priv.join);
|
||||
torture_leave_domain(torture, priv.join);
|
||||
torture_fail(torture, "Unable to connect to DRSUAPI pipe");
|
||||
}
|
||||
|
||||
@ -776,7 +776,7 @@ bool torture_rpc_drsuapi_cracknames(struct torture_context *torture)
|
||||
ret &= test_DsUnbind(p, torture, &priv);
|
||||
}
|
||||
|
||||
torture_leave_domain(priv.join);
|
||||
torture_leave_domain(torture, priv.join);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -325,7 +325,7 @@ bool test_DsCrackNames(struct torture_context *tctx,
|
||||
return ret;
|
||||
}
|
||||
|
||||
ldb = ldb_init(mem_ctx);
|
||||
ldb = ldb_init(mem_ctx, tctx->ev);
|
||||
|
||||
realm_dn_str = r.out.ctr.ctr1->array[0].result_name;
|
||||
realm_dn = ldb_dn_new(mem_ctx, ldb, realm_dn_str);
|
||||
|
@ -48,7 +48,7 @@ bool torture_rpc_join(struct torture_context *torture)
|
||||
smbcli_tdis(cli);
|
||||
|
||||
/* Leave domain. */
|
||||
torture_leave_domain(tj);
|
||||
torture_leave_domain(torture, tj);
|
||||
|
||||
/* Join domain as a domain controller. */
|
||||
tj = torture_join_domain(torture, TORTURE_NETBIOS_NAME,
|
||||
@ -75,7 +75,7 @@ bool torture_rpc_join(struct torture_context *torture)
|
||||
smbcli_tdis(cli);
|
||||
|
||||
/* Leave domain. */
|
||||
torture_leave_domain(tj);
|
||||
torture_leave_domain(torture, tj);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -2280,7 +2280,7 @@ bool torture_rpc_lsa(struct torture_context *tctx)
|
||||
ret = false;
|
||||
}
|
||||
|
||||
torture_leave_domain(join);
|
||||
torture_leave_domain(tctx, join);
|
||||
|
||||
} else {
|
||||
if (!test_many_LookupSids(p, tctx, handle)) {
|
||||
|
@ -33,7 +33,7 @@ static bool torture_rpc_teardown (struct torture_context *tcase,
|
||||
struct torture_rpc_tcase_data *tcase_data =
|
||||
(struct torture_rpc_tcase_data *)data;
|
||||
if (tcase_data->join_ctx != NULL)
|
||||
torture_leave_domain(tcase_data->join_ctx);
|
||||
torture_leave_domain(tcase, tcase_data->join_ctx);
|
||||
talloc_free(tcase_data);
|
||||
return true;
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ struct test_join *torture_join_domain(struct torture_context *tctx,
|
||||
uint32_t acct_flags,
|
||||
struct cli_credentials **machine_credentials);
|
||||
const struct dom_sid *torture_join_sid(struct test_join *join);
|
||||
void torture_leave_domain(struct test_join *join);
|
||||
void torture_leave_domain(struct torture_context *tctx, struct test_join *join);
|
||||
struct torture_rpc_tcase *torture_suite_add_rpc_iface_tcase(struct torture_suite *suite,
|
||||
const char *name,
|
||||
const struct ndr_interface_table *table);
|
||||
|
@ -1847,9 +1847,9 @@ bool torture_rpc_samlogon(struct torture_context *torture)
|
||||
failed:
|
||||
talloc_free(mem_ctx);
|
||||
|
||||
torture_leave_domain(join_ctx);
|
||||
torture_leave_domain(user_ctx);
|
||||
torture_leave_domain(user_ctx_wrong_wks);
|
||||
torture_leave_domain(user_ctx_wrong_time);
|
||||
torture_leave_domain(torture, join_ctx);
|
||||
torture_leave_domain(torture, user_ctx);
|
||||
torture_leave_domain(torture, user_ctx_wrong_wks);
|
||||
torture_leave_domain(torture, user_ctx_wrong_time);
|
||||
return ret;
|
||||
}
|
||||
|
@ -639,7 +639,7 @@ static bool test_samr_connect(struct torture_context *tctx,
|
||||
|
||||
|
||||
/* remove the test user */
|
||||
torture_leave_domain(testuser);
|
||||
torture_leave_domain(tctx, testuser);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -1629,9 +1629,9 @@ bool torture_rpc_samsync(struct torture_context *torture)
|
||||
}
|
||||
failed:
|
||||
|
||||
torture_leave_domain(join_ctx);
|
||||
torture_leave_domain(join_ctx2);
|
||||
torture_leave_domain(user_ctx);
|
||||
torture_leave_domain(torture, join_ctx);
|
||||
torture_leave_domain(torture, join_ctx2);
|
||||
torture_leave_domain(torture, user_ctx);
|
||||
|
||||
talloc_free(mem_ctx);
|
||||
|
||||
|
@ -385,7 +385,7 @@ static bool test_schannel(struct torture_context *tctx,
|
||||
torture_assert(tctx, test_netlogon_ops(p_netlogon3, tctx, credentials, creds),
|
||||
"Failed to processed NOT schannel secured NETLOGON ops without new ServerAuth");
|
||||
|
||||
torture_leave_domain(join_ctx);
|
||||
torture_leave_domain(tctx, join_ctx);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -482,7 +482,7 @@ bool torture_rpc_schannel2(struct torture_context *torture)
|
||||
if (!test_netlogon_ex_ops(p2, torture, credentials2, NULL))
|
||||
return false;
|
||||
|
||||
torture_leave_domain(join_ctx);
|
||||
torture_leave_domain(torture, join_ctx);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -829,7 +829,7 @@ bool torture_rpc_schannel_bench1(struct torture_context *torture)
|
||||
(unsigned long long)s->total,
|
||||
(unsigned)s->total/s->timelimit);
|
||||
|
||||
torture_leave_domain(s->join_ctx1);
|
||||
torture_leave_domain(s->join_ctx2);
|
||||
torture_leave_domain(torture, s->join_ctx1);
|
||||
torture_leave_domain(torture, s->join_ctx2);
|
||||
return true;
|
||||
}
|
||||
|
@ -246,7 +246,7 @@ again:
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("SetUserInfo level %u - no session key - %s\n",
|
||||
s.in.level, nt_errstr(status));
|
||||
torture_leave_domain(join);
|
||||
torture_leave_domain(torture, join);
|
||||
goto failed;
|
||||
}
|
||||
|
||||
@ -294,7 +294,7 @@ again:
|
||||
return join;
|
||||
|
||||
failed:
|
||||
torture_leave_domain(join);
|
||||
torture_leave_domain(torture, join);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -425,7 +425,9 @@ struct policy_handle *torture_join_samr_user_policy(struct test_join *join)
|
||||
return &join->user_handle;
|
||||
}
|
||||
|
||||
static NTSTATUS torture_leave_ads_domain(TALLOC_CTX *mem_ctx, struct libnet_JoinDomain *libnet_r)
|
||||
static NTSTATUS torture_leave_ads_domain(struct torture_context *torture,
|
||||
TALLOC_CTX *mem_ctx,
|
||||
struct libnet_JoinDomain *libnet_r)
|
||||
{
|
||||
int rtn;
|
||||
TALLOC_CTX *tmp_ctx;
|
||||
@ -446,7 +448,7 @@ static NTSTATUS torture_leave_ads_domain(TALLOC_CTX *mem_ctx, struct libnet_Join
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
}
|
||||
|
||||
ldb_ctx = ldb_init(tmp_ctx);
|
||||
ldb_ctx = ldb_init(tmp_ctx, torture->ev);
|
||||
if (!ldb_ctx) {
|
||||
libnet_r->out.error_string = NULL;
|
||||
talloc_free(tmp_ctx);
|
||||
@ -494,7 +496,7 @@ static NTSTATUS torture_leave_ads_domain(TALLOC_CTX *mem_ctx, struct libnet_Join
|
||||
leave the domain, deleting the machine acct
|
||||
*/
|
||||
|
||||
_PUBLIC_ void torture_leave_domain(struct test_join *join)
|
||||
_PUBLIC_ void torture_leave_domain(struct torture_context *torture, struct test_join *join)
|
||||
{
|
||||
struct samr_DeleteUser d;
|
||||
NTSTATUS status;
|
||||
@ -504,8 +506,8 @@ _PUBLIC_ void torture_leave_domain(struct test_join *join)
|
||||
}
|
||||
d.in.user_handle = &join->user_handle;
|
||||
d.out.user_handle = &join->user_handle;
|
||||
|
||||
/* Delete machine account */
|
||||
|
||||
/* Delete machine account */
|
||||
status = dcerpc_samr_DeleteUser(join->p, join, &d);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("Delete of machine account %s failed\n",
|
||||
@ -516,7 +518,7 @@ _PUBLIC_ void torture_leave_domain(struct test_join *join)
|
||||
}
|
||||
|
||||
if (join->libnet_r) {
|
||||
status = torture_leave_ads_domain(join, join->libnet_r);
|
||||
status = torture_leave_ads_domain(torture, join, join->libnet_r);
|
||||
}
|
||||
|
||||
talloc_free(join);
|
||||
|
@ -141,6 +141,7 @@ static void winbind_task_init(struct task_server *task)
|
||||
service->task = task;
|
||||
|
||||
service->primary_sid = secrets_get_domain_sid(service,
|
||||
task->event_ctx,
|
||||
task->lp_ctx,
|
||||
lp_workgroup(task->lp_ctx));
|
||||
if (service->primary_sid == NULL) {
|
||||
|
Loading…
Reference in New Issue
Block a user