From 152f415ba8c289f85981f672b163816df9d4ad9f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 15 Dec 2009 11:00:30 +1100 Subject: s4-dsdb: added dsdb_dn_is_deleted_val() This is used to determine if a extedned DN has the 'DELETED=1' component Pair-Programmed-With: Andrew Bartlett --- source4/dsdb/common/util.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'source4/dsdb/common') diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c index 5b8365a3e1..30eb28c69c 100644 --- a/source4/dsdb/common/util.c +++ b/source4/dsdb/common/util.c @@ -2736,3 +2736,17 @@ NTSTATUS dsdb_get_extended_dn_guid(struct ldb_dn *dn, struct GUID *guid) return GUID_from_ndr_blob(v, guid); } + +/* + return true if a ldb_val containing a DN in storage form is deleted + */ +bool dsdb_dn_is_deleted_val(struct ldb_val *val) +{ + /* this relies on the sort order and exact format of + linearized extended DNs */ + if (val->length >= 12 && + strncmp((const char *)val->data, ";", 12) == 0) { + return true; + } + return false; +} -- cgit