diff options
author | Andrew Tridgell <tridge@samba.org> | 2009-10-02 22:39:44 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2009-10-02 22:39:44 +1000 |
commit | 959eff92064d3d2224f4f232be63acbbe045ee8f (patch) | |
tree | c3dbda3c160ca65669026ec6e0bc7a8480d0251a | |
parent | 52b10ff3c5b4291c2f99922016417b2c4ae215e8 (diff) | |
download | samba-959eff92064d3d2224f4f232be63acbbe045ee8f.tar.gz samba-959eff92064d3d2224f4f232be63acbbe045ee8f.tar.bz2 samba-959eff92064d3d2224f4f232be63acbbe045ee8f.zip |
Revert "s4:ldb Remove LTDB_PACKING_FORMAT_NODN"
This reverts commit bcbf0ae1e707c2355824800dc213d364070f070a.
-rw-r--r-- | source4/lib/ldb/ldb_tdb/ldb_pack.c | 7 | ||||
-rw-r--r-- | source4/lib/ldb/ldb_tdb/ldb_search.c | 9 |
2 files changed, 16 insertions, 0 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_pack.c b/source4/lib/ldb/ldb_tdb/ldb_pack.c index 7fe61c020a..e7aeb47e72 100644 --- a/source4/lib/ldb/ldb_tdb/ldb_pack.c +++ b/source4/lib/ldb/ldb_tdb/ldb_pack.c @@ -36,6 +36,9 @@ /* change this if the data format ever changes */ #define LTDB_PACKING_FORMAT 0x26011967 +/* old packing formats */ +#define LTDB_PACKING_FORMAT_NODN 0x26011966 + /* use a portable integer format */ static void put_uint32(uint8_t *p, int ofs, unsigned int val) { @@ -180,6 +183,10 @@ int ltdb_unpack_data(struct ldb_module *module, remaining = data->dsize - 8; switch (format) { + case LTDB_PACKING_FORMAT_NODN: + message->dn = NULL; + break; + case LTDB_PACKING_FORMAT: len = strnlen((char *)p, remaining); if (len == remaining) { diff --git a/source4/lib/ldb/ldb_tdb/ldb_search.c b/source4/lib/ldb/ldb_tdb/ldb_search.c index a089a2f826..a6647ccd50 100644 --- a/source4/lib/ldb/ldb_tdb/ldb_search.c +++ b/source4/lib/ldb/ldb_tdb/ldb_search.c @@ -401,6 +401,15 @@ static int search_func(struct tdb_context *tdb, TDB_DATA key, TDB_DATA data, voi return -1; } + if (!msg->dn) { + msg->dn = ldb_dn_new(msg, ldb, + (char *)key.dptr + 3); + if (msg->dn == NULL) { + talloc_free(msg); + return -1; + } + } + /* see if it matches the given expression */ if (!ldb_match_msg(ldb, msg, ac->tree, ac->base, ac->scope)) { |