ldb files

Stefan (metze) Metzmacher metze at samba.org
Sat Nov 25 09:50:22 GMT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Stefan (metze) Metzmacher schrieb:
> Hi Simo,
>
> this works with rev 19744, but not with the current tree...
>
> bin/ldbsearch -H ~/prefix/samba4/var/lib/samba/private/sam.ldb -b
> CN=Partitions,CN=Configuration,DC=sernoxdom4,DC=mx,DC=base
> ncName=DC=sernoxdom4,DC=mx,DC=base

I found this:
09:30 < metze> simo: I found the bug
09:30 < metze> it's the index record
09:30 < metze> it was like this:
09:30 < metze> key(45) = "DN=@INDEX:NCNAME:DC=SERNOXDOM4,DC=MX,DC=BASE\00"
09:30 < metze> data(136) =
"g\19\01&\01\00\00\00 at INDEX:NCNAME:DC=SERNOXDOM4,DC=MX,DC=BASE\00 at IDX\00\01\00\00\00H\00\00\00CN=SERNOXDOM4,CN=P
09:30 < metze> artitions,CN=Configuration,DC=sernoxdom4,DC=mx,DC=base\00"
09:31 < metze> and it's like this now
09:31 < metze> key(50) =
"DN=@INDEX:NCNAME:DC\5C=sernoxdom4\5C,DC\5C=mx\5C,DC\5C=base\00"
09:31 < metze> data(136) =
"g\19\01&\01\00\00\00 at INDEX:NCNAME:DC=sernoxdom4,DC=mx,DC=base\00 at IDX\00\01\00\00\00H\00\00\00CN=SERNOXDOM4,CN=P
09:31 < metze> artitions,CN=Configuration,DC=sernoxdom4,DC=mx,DC=base\00"
09:31 < metze> so where do the \5C come from

(gdb) p *dn_key
$12 = {ldb = 0x8356708, special = true, invalid = false, valid_case = false,
  linearized = 0x8414210 "@INDEX:NCNAME:DC=sernoxdom4,DC=mx,DC=base2",
casefold = 0x0, comp_num = 0, components = 0x0}
(gdb) n
862             talloc_steal(msg, dn_key);
(gdb) n
864             ret = ltdb_search_dn1(module, dn_key, msg);
(gdb) b ltdb_search_dn1
Breakpoint 4 at 0x814bf6a: file lib/ldb/ldb_tdb/ldb_search.c, line 214.
(gdb) n

Breakpoint 4, ltdb_search_dn1 (module=0x8377ef0, dn=0x84139a8,
msg=0x8412c70) at lib/ldb/ldb_tdb/ldb_search.c:214
214             struct ltdb_private *ltdb = module->private_data;
(gdb) n
218             memset(msg, 0, sizeof(*msg));
(gdb) n
221             tdb_key = ltdb_key(module, dn);
(gdb) n
222             if (!tdb_key.dptr) {
(gdb) n
226             tdb_data = tdb_fetch(ltdb->tdb, tdb_key);
(gdb) p tdb_key
$13 = {dptr = 0x8414118
"DN=@INDEX:NCNAME:DC\\=sernoxdom4\\,DC\\=mx\\,DC\\=base2", dsize = 51}
(gdb) p dn
$14 = (struct ldb_dn *) 0x84139a8
(gdb) p *dn
$15 = {ldb = 0x8356708, special = true, invalid = false, valid_case = true,
  linearized = 0x8414210 "@INDEX:NCNAME:DC=sernoxdom4,DC=mx,DC=base2",
  casefold = 0x8413ef0
"@INDEX:NCNAME:DC\\=sernoxdom4\\,DC\\=mx\\,DC\\=base2", comp_num = 0,
components = 0x0}

so ltdb_key() -> ldb_dn_get_casefold() is the problem...

Here's a possible fix for it...

metze
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFFaBHem70gjA5TCD8RArhAAKCB7TWEOPjQvI45kjU1Ia2dSnFqAwCdETf9
rB5FeEbywUPQOH7daf2y9Wg=
=f9lO
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ldb-dn-casefold-01.diff
Type: text/x-patch
Size: 1719 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20061125/d9379a41/ldb-dn-casefold-01.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ldb-dn-casefold-01.diff.sig
Type: application/pgp-signature
Size: 65 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20061125/d9379a41/ldb-dn-casefold-01.diff.bin


More information about the samba-technical mailing list