summaryrefslogtreecommitdiff
path: root/source4/dsdb
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2010-06-10 21:29:57 +1000
committerAndrew Bartlett <abartlet@samba.org>2010-06-12 11:18:41 +1000
commit088d5b76ca416e798b505d9fd9266db73a0a8450 (patch)
tree1a10170b5d639de63a87b46146da58ee4479c748 /source4/dsdb
parent57b6979ad034b50debd47979e05b925daa54b5a4 (diff)
downloadsamba-088d5b76ca416e798b505d9fd9266db73a0a8450.tar.gz
samba-088d5b76ca416e798b505d9fd9266db73a0a8450.tar.bz2
samba-088d5b76ca416e798b505d9fd9266db73a0a8450.zip
s4:dsdb Simplfy match of objectclass in dsdb_schema_set_el_from_ldb_msg
There is no need to do a full ldb_match_msg() for a simple case insensitive string. Andrew Bartlett
Diffstat (limited to 'source4/dsdb')
-rw-r--r--source4/dsdb/schema/schema_set.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/source4/dsdb/schema/schema_set.c b/source4/dsdb/schema/schema_set.c
index c57f5f10dd..5ecbad214f 100644
--- a/source4/dsdb/schema/schema_set.c
+++ b/source4/dsdb/schema/schema_set.c
@@ -549,24 +549,11 @@ int dsdb_schema_fill_extended_dn(struct ldb_context *ldb, struct dsdb_schema *sc
WERROR dsdb_schema_set_el_from_ldb_msg(struct ldb_context *ldb, struct dsdb_schema *schema,
struct ldb_message *msg)
{
- static struct ldb_parse_tree *attr_tree, *class_tree;
- if (!attr_tree) {
- attr_tree = ldb_parse_tree(talloc_autofree_context(), "(objectClass=attributeSchema)");
- if (!attr_tree) {
- return WERR_NOMEM;
- }
- }
-
- if (!class_tree) {
- class_tree = ldb_parse_tree(talloc_autofree_context(), "(objectClass=classSchema)");
- if (!class_tree) {
- return WERR_NOMEM;
- }
- }
-
- if (ldb_match_msg(ldb, msg, attr_tree, NULL, LDB_SCOPE_BASE)) {
+ if (samdb_find_attribute(ldb, msg,
+ "objectclass", "attributeSchema") != NULL) {
return dsdb_attribute_from_ldb(ldb, schema, msg);
- } else if (ldb_match_msg(ldb, msg, class_tree, NULL, LDB_SCOPE_BASE)) {
+ } else if (samdb_find_attribute(ldb, msg,
+ "objectclass", "classSchema") != NULL) {
return dsdb_class_from_ldb(schema, msg);
}