diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-09-22 02:05:02 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:58:56 -0500 |
commit | 4b09c0e5d9619fea420da80022829682e028ea57 (patch) | |
tree | aff2f9350a675e1035f47c7685513042fa94fa6e /source4/lib/ldb/ldb_tdb | |
parent | a2a97238f5ade51d7908803dee11d913531b7821 (diff) | |
download | samba-4b09c0e5d9619fea420da80022829682e028ea57.tar.gz samba-4b09c0e5d9619fea420da80022829682e028ea57.tar.bz2 samba-4b09c0e5d9619fea420da80022829682e028ea57.zip |
r2485: - add a test case in ldbtest for a bug pointed out by Jon Haswell.
- fixed the bug shown with the above test, by initialising the
sequence number to something different from the value used in
ltdb_cache_free()
(This used to be commit 856cdf82f24aada074ee5c605cccb2e8ceeea487)
Diffstat (limited to 'source4/lib/ldb/ldb_tdb')
-rw-r--r-- | source4/lib/ldb/ldb_tdb/ldb_cache.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_cache.c b/source4/lib/ldb/ldb_tdb/ldb_cache.c index 2a879f384c..55dea406b5 100644 --- a/source4/lib/ldb/ldb_tdb/ldb_cache.c +++ b/source4/lib/ldb/ldb_tdb/ldb_cache.c @@ -45,8 +45,12 @@ static int ltdb_baseinfo_init(struct ldb_context *ldb) struct ldb_message_element el; struct ldb_val val; int ret; + /* the initial sequence number must be different from the one + set in ltdb_cache_free(). Thanks to Jon for pointing this + out. */ + const char *initial_sequence_number = "1"; - ltdb->sequence_number = 0; + ltdb->sequence_number = atof(initial_sequence_number); msg.num_elements = 1; msg.elements = ⪙ @@ -64,7 +68,7 @@ static int ltdb_baseinfo_init(struct ldb_context *ldb) el.values = &val; el.num_values = 1; el.flags = 0; - val.data = ldb_strdup(ldb, "0"); + val.data = ldb_strdup(ldb, initial_sequence_number); if (!val.data) { ldb_free(ldb, el.name); ldb_free(ldb, msg.dn); |