ldb: don't return special DNs on non-base searches
authorAndrew Tridgell <tridge@samba.org>
Wed, 13 Jul 2011 02:25:09 +0000 (12:25 +1000)
committerAndrew Tridgell <tridge@samba.org>
Wed, 13 Jul 2011 10:51:05 +0000 (12:51 +0200)
to look at a special DN, give the full DN

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

lib/ldb/common/ldb_match.c

index a42cf9449d338320b0fb9bcae35877c5f254c6c1..c23e80478af239dcb7129874261d3ec509e11246 100644 (file)
@@ -463,6 +463,11 @@ static int ldb_match_message(struct ldb_context *ldb,
 
        *matched = false;
 
+       if (scope != LDB_SCOPE_BASE && ldb_dn_is_special(msg->dn)) {
+               /* don't match special records except on base searches */
+               return LDB_SUCCESS;
+       }
+
        switch (tree->operation) {
        case LDB_OP_AND:
                for (i=0;i<tree->u.list.num_elements;i++) {