diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c index e32f4750cf5..5e0bccb36b0 100644 --- a/source4/dsdb/common/util.c +++ b/source4/dsdb/common/util.c @@ -5902,10 +5902,14 @@ bool dsdb_attr_in_parse_tree(struct ldb_parse_tree *tree, case LDB_OP_NOT: return dsdb_attr_in_parse_tree(tree->u.isnot.child, attr); case LDB_OP_EQUALITY: + if (ldb_attr_cmp(tree->u.equality.attr, attr) == 0) { + return true; + } + return false; case LDB_OP_GREATER: case LDB_OP_LESS: case LDB_OP_APPROX: - if (ldb_attr_cmp(tree->u.equality.attr, attr) == 0) { + if (ldb_attr_cmp(tree->u.comparison.attr, attr) == 0) { return true; } return false; diff --git a/source4/dsdb/samdb/ldb_modules/acl_read.c b/source4/dsdb/samdb/ldb_modules/acl_read.c index e82af68c312..0b6280c3a8f 100644 --- a/source4/dsdb/samdb/ldb_modules/acl_read.c +++ b/source4/dsdb/samdb/ldb_modules/acl_read.c @@ -252,18 +252,27 @@ static int ldb_parse_tree_collect_acl_attrs(const struct ldb_module *module, return 0; } - FALL_THROUGH; - case LDB_OP_EQUALITY: if (ldb_attr_always_visible(tree->u.present.attr)) { /* No need to check this attribute. */ return 0; } - FALL_THROUGH; + break; + + case LDB_OP_EQUALITY: + if (ldb_attr_always_visible(tree->u.equality.attr)) { + /* No need to check this attribute. */ + return 0; + } + + break; + default: /* single attribute in tree */ - attr = ldb_parse_tree_get_attr(tree); - return attr_vec_add_unique(mem_ctx, attrs, attr); + break; } + + attr = ldb_parse_tree_get_attr(tree); + return attr_vec_add_unique(mem_ctx, attrs, attr); } /* diff --git a/source4/dsdb/samdb/ldb_modules/anr.c b/source4/dsdb/samdb/ldb_modules/anr.c index 63aafa02043..d0cdaa3ddb8 100644 --- a/source4/dsdb/samdb/ldb_modules/anr.c +++ b/source4/dsdb/samdb/ldb_modules/anr.c @@ -296,10 +296,14 @@ static int parse_tree_anr_present(struct ldb_parse_tree *tree, void *private_con struct anr_present_ctx *ctx = private_context; switch (tree->operation) { case LDB_OP_EQUALITY: + if (ldb_attr_cmp(tree->u.equality.attr, ctx->attr) == 0) { + ctx->found_anr = true; + } + break; case LDB_OP_GREATER: case LDB_OP_LESS: case LDB_OP_APPROX: - if (ldb_attr_cmp(tree->u.equality.attr, ctx->attr) == 0) { + if (ldb_attr_cmp(tree->u.comparison.attr, ctx->attr) == 0) { ctx->found_anr = true; } break; diff --git a/source4/dsdb/samdb/ldb_modules/operational.c b/source4/dsdb/samdb/ldb_modules/operational.c index bfde14db1a3..d7c40c82efc 100644 --- a/source4/dsdb/samdb/ldb_modules/operational.c +++ b/source4/dsdb/samdb/ldb_modules/operational.c @@ -1696,10 +1696,14 @@ static int operational_present(struct ldb_parse_tree *tree, void *private_contex struct operational_present_ctx *ctx = private_context; switch (tree->operation) { case LDB_OP_EQUALITY: + if (ldb_attr_cmp(tree->u.equality.attr, ctx->attr) == 0) { + ctx->found_operational = true; + } + break; case LDB_OP_GREATER: case LDB_OP_LESS: case LDB_OP_APPROX: - if (ldb_attr_cmp(tree->u.equality.attr, ctx->attr) == 0) { + if (ldb_attr_cmp(tree->u.comparison.attr, ctx->attr) == 0) { ctx->found_operational = true; } break; diff --git a/source4/dsdb/samdb/ldb_modules/resolve_oids.c b/source4/dsdb/samdb/ldb_modules/resolve_oids.c index b5c5f8efee7..5c1639671e5 100644 --- a/source4/dsdb/samdb/ldb_modules/resolve_oids.c +++ b/source4/dsdb/samdb/ldb_modules/resolve_oids.c @@ -111,11 +111,14 @@ static int resolve_oids_parse_tree_need(struct ldb_context *ldb, return resolve_oids_parse_tree_need(ldb, schema, tree->u.isnot.child); case LDB_OP_EQUALITY: + attr = tree->u.equality.attr; + valp = &tree->u.equality.value; + break; case LDB_OP_GREATER: case LDB_OP_LESS: case LDB_OP_APPROX: - attr = tree->u.equality.attr; - valp = &tree->u.equality.value; + attr = tree->u.comparison.attr; + valp = &tree->u.comparison.value; break; case LDB_OP_SUBSTRING: attr = tree->u.substring.attr; @@ -300,11 +303,14 @@ static int resolve_oids_parse_tree_replace(struct ldb_context *ldb, return resolve_oids_parse_tree_replace(ldb, schema, tree->u.isnot.child); case LDB_OP_EQUALITY: + attrp = &tree->u.equality.attr; + valp = &tree->u.equality.value; + break; case LDB_OP_GREATER: case LDB_OP_LESS: case LDB_OP_APPROX: - attrp = &tree->u.equality.attr; - valp = &tree->u.equality.value; + attrp = &tree->u.comparison.attr; + valp = &tree->u.comparison.value; break; case LDB_OP_SUBSTRING: attrp = &tree->u.substring.attr;