From 5a39817212aa34ef181e9ed72851b077ba088260 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 1 Jun 2009 16:36:21 +1000 Subject: added support for unique indexing in ldb When a attribute is marked as LDB_ATTR_FLAG_UNIQUE_INDEX then attempts to add a 2nd record that has the same attribute value for this attribute as another record will fail. This provides a much more efficient mechanism for ensuring that attributes like objectGUID are unique --- source4/lib/ldb/include/ldb.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source4/lib/ldb/include') diff --git a/source4/lib/ldb/include/ldb.h b/source4/lib/ldb/include/ldb.h index 1b6b41aa43..8e4e2e0db3 100644 --- a/source4/lib/ldb/include/ldb.h +++ b/source4/lib/ldb/include/ldb.h @@ -375,6 +375,12 @@ const struct ldb_dn_extended_syntax *ldb_dn_extended_syntax_by_name(struct ldb_c */ #define LDB_ATTR_FLAG_FIXED (1<<2) +/* + when this is set, attempts to create two records which have the same + value for this attribute will return LDB_ERR_ENTRY_ALREADY_EXISTS + */ +#define LDB_ATTR_FLAG_UNIQUE_INDEX (1<<3) + /** LDAP attribute syntax for a DN -- cgit