From 9405377a7027ea1d8ea98942efeb69de672d38e4 Mon Sep 17 00:00:00 2001 From: Kamen Mazdrashki Date: Thu, 29 Oct 2009 03:16:30 +0200 Subject: s4/drs: prefixMap lookup by full_OID implementation Signed-off-by: Stefan Metzmacher --- source4/dsdb/schema/schema_prefixmap.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/source4/dsdb/schema/schema_prefixmap.c b/source4/dsdb/schema/schema_prefixmap.c index cda6f75e5a..acdb034a9b 100644 --- a/source4/dsdb/schema/schema_prefixmap.c +++ b/source4/dsdb/schema/schema_prefixmap.c @@ -214,6 +214,31 @@ WERROR dsdb_schema_pfm_find_binary_oid(const struct dsdb_schema_prefixmap *pfm, return WERR_DS_NO_MSDS_INTID; } +/** + * Lookup full-oid in prefixMap + * Note: this may be slow. + */ +WERROR dsdb_schema_pfm_find_oid(const struct dsdb_schema_prefixmap *pfm, + const char *full_oid, + uint32_t *_idx) +{ + WERROR werr; + DATA_BLOB bin_oid; + + ZERO_STRUCT(bin_oid); + + /* make partial-binary-oid to look for */ + werr = _dsdb_pfm_make_binary_oid(full_oid, NULL, &bin_oid, NULL); + W_ERROR_NOT_OK_RETURN(werr); + + /* lookup the partial-oid */ + werr = dsdb_schema_pfm_find_binary_oid(pfm, bin_oid, _idx); + + data_blob_free(&bin_oid); + + return werr; +} + /** * Make ATTID for given OID * Reference: [MS-DRSR] section 5.12.2 -- cgit