From 77db3973c417cc934485dbd6bf1a8a1c84c1b30b Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 21 Sep 2006 06:44:12 +0000 Subject: r18781: Move the usnCreated and usnChanged handling around again. This moves these attributes from objectguid into an optional backend (objectguid), used by ltdb. For OpenLDAP, the entryUUID module converts entryCSN into usnChanged. This also changes the sequence number API, and uses 'time based' sequence numbers, when an LDAP or similar backend is detected. To assist this, we also store the last modified time in the TDB, whenever we change a value. Andrew Bartlett (This used to be commit 72858f859483c0c532dddb2c146d6bd7b9be5072) --- source4/lib/ldb/include/ldb.h | 11 ++++++----- source4/lib/ldb/include/ldb_private.h | 10 ++++++++++ 2 files changed, 16 insertions(+), 5 deletions(-) (limited to 'source4/lib/ldb/include') diff --git a/source4/lib/ldb/include/ldb.h b/source4/lib/ldb/include/ldb.h index 78d701689d..cf4a1f282b 100644 --- a/source4/lib/ldb/include/ldb.h +++ b/source4/lib/ldb/include/ldb.h @@ -740,7 +740,13 @@ struct ldb_register_partition { }; struct ldb_sequence_number { + enum ldb_sequence_type { + LDB_SEQ_HIGHEST_SEQ, + LDB_SEQ_HIGHEST_TIMESTAMP, + LDB_SEQ_NEXT + } type; uint64_t seq_num; + uint32_t flags; }; typedef int (*ldb_request_callback_t)(struct ldb_context *, void *, struct ldb_reply *); @@ -922,11 +928,6 @@ int ldb_rename(struct ldb_context *ldb, const struct ldb_dn *olddn, const struct */ int ldb_delete(struct ldb_context *ldb, const struct ldb_dn *dn); -/** - Obtain current database sequence number -*/ -int ldb_sequence_number(struct ldb_context *ldb, uint64_t *seq_num); - /** start a transaction */ diff --git a/source4/lib/ldb/include/ldb_private.h b/source4/lib/ldb/include/ldb_private.h index d66b6f1cc7..96b71ff3b4 100644 --- a/source4/lib/ldb/include/ldb_private.h +++ b/source4/lib/ldb/include/ldb_private.h @@ -207,4 +207,14 @@ int check_critical_controls(struct ldb_control **controls); /* The following definitions come from lib/ldb/common/ldb_utf8.c */ char *ldb_casefold_default(void *context, void *mem_ctx, const char *s); + +/** + Obtain current/next database sequence number +*/ +int ldb_sequence_number(struct ldb_context *ldb, enum ldb_sequence_type type, uint64_t *seq_num); + +#define LDB_SEQ_GLOBAL_SEQUENCE 0x01 +#define LDB_SEQ_TIMESTAMP_SEQUENCE 0x02 + + #endif -- cgit