From d6f20f8e92bbbf7b8ac5ace83aae15bad8ef8bba Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 4 May 2004 05:58:22 +0000 Subject: r462: added an explanation about the rather complex ltdb_key() function (This used to be commit 894e44022d16d9ff43f421fb15495845710000ab) --- source4/lib/ldb/ldb_tdb/ldb_tdb.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source4/lib/ldb/ldb_tdb') diff --git a/source4/lib/ldb/ldb_tdb/ldb_tdb.c b/source4/lib/ldb/ldb_tdb/ldb_tdb.c index 92b88e4fb5..c674f0c27e 100644 --- a/source4/lib/ldb/ldb_tdb/ldb_tdb.c +++ b/source4/lib/ldb/ldb_tdb/ldb_tdb.c @@ -54,6 +54,15 @@ struct TDB_DATA ltdb_key(struct ldb_context *ldb, const char *dn) /* most DNs are case insensitive. The exception is index DNs for case sensitive attributes + + there are 3 cases dealt with in this code: + + 1) if the dn doesn't start with @INDEX: then uppercase whole dn + 2) if the dn starts with @INDEX:attr and 'attr' is a case insensitive + attribute then uppercase whole dn + 3) if the dn starts with @INDEX:attr and 'attr' is a case sensitive + attribute then uppercase up to the value of the attribute, but + not the value itself */ if (strncmp(dn, prefix, strlen(prefix)) == 0 && (s = strchr(dn+strlen(prefix), ':'))) { -- cgit