summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-06-24 00:18:20 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:18:44 -0500
commitbdee131f30e1bef31498b08bb648ddee35ea4892 (patch)
treec0ad71d994361020334bb280a9a5cbd31f73db5b /source4/lib
parent3022bfef70f4d76d3a12cfb8ee8cbdc72644b58f (diff)
downloadsamba-bdee131f30e1bef31498b08bb648ddee35ea4892.tar.gz
samba-bdee131f30e1bef31498b08bb648ddee35ea4892.tar.bz2
samba-bdee131f30e1bef31498b08bb648ddee35ea4892.zip
r7860: switch our ldb storage format to use a NDR encoded objectSid. This is
quite a large change as we had lots of code that assumed that objectSid was a string in S- format. metze and simo tried to convince me to use NDR format months ago, but I didn't listen, so its fair that I have the pain of fixing all the code now :-) This builds on the ldb_register_samba_handlers() and ldif handlers code I did earlier this week. There are still three parts of this conversion I have not finished: - the ltdb index records need to use the string form of the objectSid (to keep the DNs sane). Until that it done I have disabled indexing on objectSid, which is a big performance hit, but allows us to pass all our tests while I rejig the indexing system to use a externally supplied conversion function - I haven't yet put in place the code that allows client to use the "S-xxx-yyy" form for objectSid in ldap search expressions. w2k3 supports this, presumably by looking for the "S-" prefix to determine what type of objectSid form is being used by the client. I have been working on ways to handle this, but am not happy with them yet so they aren't part of this patch - I need to change pidl to generate push functions that take a "const void *" instead of a "void*" for the data pointer. That will fix the couple of new warnings this code generates. Luckily it many places the conversion to NDR formatted records actually simplified the code, as it means we no longer need as many calls to dom_sid_parse_talloc(). In some places it got more complex, but not many. (This used to be commit d40bc2fa8ddd43560315688eebdbe98bdd02756c)
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/db_wrap.c9
-rw-r--r--source4/lib/ldb/config.mk4
-rw-r--r--source4/lib/ldb/samba/ldif_handlers.c6
3 files changed, 11 insertions, 8 deletions
diff --git a/source4/lib/db_wrap.c b/source4/lib/db_wrap.c
index c277f2d975..b000225bbf 100644
--- a/source4/lib/db_wrap.c
+++ b/source4/lib/db_wrap.c
@@ -102,6 +102,15 @@ struct ldb_context *ldb_wrap_connect(TALLOC_CTX *mem_ctx,
ev = talloc_find_parent_bytype(mem_ctx, struct event_context);
if (ev) {
ldb_set_opaque(ldb, "EventContext", ev);
+ } else {
+ DEBUG(0,("WARNING: event_context not found\n"));
+ talloc_show_parents(mem_ctx, stdout);
+ }
+
+ ret = ldb_register_samba_handlers(ldb);
+ if (ret == -1) {
+ talloc_free(ldb);
+ return NULL;
}
ret = ldb_connect(ldb, url, flags, options);
diff --git a/source4/lib/ldb/config.mk b/source4/lib/ldb/config.mk
index 00568aeda8..cf3a7fa93d 100644
--- a/source4/lib/ldb/config.mk
+++ b/source4/lib/ldb/config.mk
@@ -72,7 +72,7 @@ ADD_OBJ_FILES = \
lib/ldb/common/ldb_modules.o \
lib/ldb/common/ldb_explode_dn.o
REQUIRED_SUBSYSTEMS = \
- LIBREPLACE LIBTALLOC
+ LIBREPLACE LIBTALLOC LDBSAMBA
NOPROTO = YES
#
# End SUBSYSTEM LIBLDB
@@ -103,7 +103,7 @@ OBJ_FILES = \
[SUBSYSTEM::LIBLDB_CMDLINE]
OBJ_FILES= \
lib/ldb/tools/cmdline.o
-REQUIRED_SUBSYSTEMS = LIBLDB LIBCMDLINE LIBBASIC LDBSAMBA
+REQUIRED_SUBSYSTEMS = LIBLDB LIBCMDLINE LIBBASIC
# End SUBSYSTEM LIBLDB_CMDLINE
################################################
diff --git a/source4/lib/ldb/samba/ldif_handlers.c b/source4/lib/ldb/samba/ldif_handlers.c
index 7252d081f1..17a45df78d 100644
--- a/source4/lib/ldb/samba/ldif_handlers.c
+++ b/source4/lib/ldb/samba/ldif_handlers.c
@@ -85,11 +85,5 @@ static const struct ldb_ldif_handler samba_handlers[] = {
*/
int ldb_register_samba_handlers(struct ldb_context *ldb)
{
-#if 0
- /* we can't enable this until we fix the sam code to handle
- non-string elements */
return ldb_ldif_add_handlers(ldb, samba_handlers, ARRAY_SIZE(samba_handlers));
-#else
- return 0;
-#endif
}