diff options
author | Andrew Tridgell <tridge@samba.org> | 2009-12-15 11:00:30 +1100 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2009-12-16 20:56:20 +1100 |
commit | 152f415ba8c289f85981f672b163816df9d4ad9f (patch) | |
tree | 340b69973d11473f25cc631938904c39fe311e5c /source4/dsdb | |
parent | d31b6360d64eb821da07f4342093d1323db7b4dd (diff) | |
download | samba-152f415ba8c289f85981f672b163816df9d4ad9f.tar.gz samba-152f415ba8c289f85981f672b163816df9d4ad9f.tar.bz2 samba-152f415ba8c289f85981f672b163816df9d4ad9f.zip |
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 <abartlet@samba.org>
Diffstat (limited to 'source4/dsdb')
-rw-r--r-- | source4/dsdb/common/util.c | 14 |
1 files changed, 14 insertions, 0 deletions
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, "<DELETED=1>;", 12) == 0) { + return true; + } + return false; +} |