summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules/util.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2013-01-02 14:52:21 +1100
committerStefan Metzmacher <metze@samba.org>2013-01-21 16:12:45 +0100
commit74bfec026921fcfc430fb7cfaee44ed75f135a99 (patch)
treefe8766324550c35727c98c0afbf883137b775dc4 /source4/dsdb/samdb/ldb_modules/util.c
parent2685a4ed6681b1a20fb26087867737ecbf8fad73 (diff)
downloadsamba-74bfec026921fcfc430fb7cfaee44ed75f135a99.tar.gz
samba-74bfec026921fcfc430fb7cfaee44ed75f135a99.tar.bz2
samba-74bfec026921fcfc430fb7cfaee44ed75f135a99.zip
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 <metze@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules/util.c')
-rw-r--r--source4/dsdb/samdb/ldb_modules/util.c13
1 files changed, 13 insertions, 0 deletions
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);
+}