From fb704d7fc1336ad73f685abd8ac454bbde8ac966 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 13 Jan 2011 11:07:15 +1100 Subject: ldb: added ldb_dn_get_extended_comp_num() this returns the number of extended components. We need this to validate a DN in the extended_dn_in module Pair-Programmed-With: Andrew Bartlett --- source4/lib/ldb/common/ldb_dn.c | 8 ++++++++ source4/lib/ldb/include/ldb.h | 1 + source4/lib/ldb/wscript | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) (limited to 'source4') diff --git a/source4/lib/ldb/common/ldb_dn.c b/source4/lib/ldb/common/ldb_dn.c index 180ff41ff4..07594551ea 100644 --- a/source4/lib/ldb/common/ldb_dn.c +++ b/source4/lib/ldb/common/ldb_dn.c @@ -1787,6 +1787,14 @@ int ldb_dn_get_comp_num(struct ldb_dn *dn) return dn->comp_num; } +int ldb_dn_get_extended_comp_num(struct ldb_dn *dn) +{ + if ( ! ldb_dn_validate(dn)) { + return -1; + } + return dn->ext_comp_num; +} + const char *ldb_dn_get_component_name(struct ldb_dn *dn, unsigned int num) { if ( ! ldb_dn_validate(dn)) { diff --git a/source4/lib/ldb/include/ldb.h b/source4/lib/ldb/include/ldb.h index 0c3196a286..e7f7ebba46 100644 --- a/source4/lib/ldb/include/ldb.h +++ b/source4/lib/ldb/include/ldb.h @@ -1758,6 +1758,7 @@ struct ldb_dn *ldb_dn_get_parent(TALLOC_CTX *mem_ctx, struct ldb_dn *dn); char *ldb_dn_canonical_string(TALLOC_CTX *mem_ctx, struct ldb_dn *dn); char *ldb_dn_canonical_ex_string(TALLOC_CTX *mem_ctx, struct ldb_dn *dn); int ldb_dn_get_comp_num(struct ldb_dn *dn); +int ldb_dn_get_extended_comp_num(struct ldb_dn *dn); const char *ldb_dn_get_component_name(struct ldb_dn *dn, unsigned int num); const struct ldb_val *ldb_dn_get_component_val(struct ldb_dn *dn, unsigned int num); const char *ldb_dn_get_rdn_name(struct ldb_dn *dn); diff --git a/source4/lib/ldb/wscript b/source4/lib/ldb/wscript index 54ecc00674..b0635c5d67 100644 --- a/source4/lib/ldb/wscript +++ b/source4/lib/ldb/wscript @@ -1,7 +1,7 @@ #!/usr/bin/env python APPNAME = 'ldb' -VERSION = '0.9.22' +VERSION = '0.9.23' blddir = 'bin' -- cgit