diff options
Diffstat (limited to 'source4/lib/ldb/common/ldb_match.c')
-rw-r--r-- | source4/lib/ldb/common/ldb_match.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/source4/lib/ldb/common/ldb_match.c b/source4/lib/ldb/common/ldb_match.c index e6ee0de027..f639effc96 100644 --- a/source4/lib/ldb/common/ldb_match.c +++ b/source4/lib/ldb/common/ldb_match.c @@ -426,3 +426,22 @@ int ldb_match_msg(struct ldb_context *ldb, return ldb_match_message(ldb, msg, tree, scope); } + +int ldb_match_msg_objectclass(const struct ldb_message *msg, + const char *objectclass) +{ + int i; + struct ldb_message_element *el = ldb_msg_find_element(msg, "objectClass"); + if (!el) { + return 0; + } + for (i=0; i < el->num_values; i++) { + if (ldb_attr_cmp((const char *)el->values[i].data, objectclass) == 0) { + return 1; + } + } + return 0; +} + + + |