From 74bfec026921fcfc430fb7cfaee44ed75f135a99 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 2 Jan 2013 14:52:21 +1100 Subject: dsdb-acl: Add helper function dsdb_get_structural_oc_from_msg() This will eventually replace get_oc_guid_from_message(), returning the full dsdb_class. Andrew Bartlett Signed-off-by: Stefan Metzmacher Reviewed-by: Stefan Metzmacher Reviewed-by: Andrew Bartlett --- source4/dsdb/samdb/ldb_modules/util.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'source4/dsdb/samdb/ldb_modules') diff --git a/source4/dsdb/samdb/ldb_modules/util.c b/source4/dsdb/samdb/ldb_modules/util.c index 253d5c1d2c..f7803e56cb 100644 --- a/source4/dsdb/samdb/ldb_modules/util.c +++ b/source4/dsdb/samdb/ldb_modules/util.c @@ -1393,3 +1393,16 @@ const struct dsdb_class *dsdb_get_last_structural_class(const struct dsdb_schema return last_class; } + +const struct dsdb_class *dsdb_get_structural_oc_from_msg(const struct dsdb_schema *schema, + const struct ldb_message *msg) +{ + struct ldb_message_element *oc_el; + + oc_el = ldb_msg_find_element(msg, "objectClass"); + if (!oc_el) { + return NULL; + } + + return dsdb_get_last_structural_class(schema, oc_el); +} -- cgit