]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ldb_tdb: Remove pointless check of ldb_dn_is_valid()
authorAndrew Bartlett <abartlet@samba.org>
Mon, 21 May 2018 03:25:33 +0000 (15:25 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 15 Aug 2018 05:08:24 +0000 (07:08 +0200)
If the DN is not valid the ltdb_search_dn1() will catch it with ldb_dn_validate() which
is the only safe way to check this.  ldb_dn_is_valid() does not actually check, but instead
returns only the result of the previous checks, if there was one.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
lib/ldb/ldb_key_value/ldb_kv_search.c

index e9964c2bd63b95ed0939d13ade5c476e8df3d169..a384ee923675091bbe229a12972a9c9d3b205cb6 100644 (file)
@@ -758,14 +758,6 @@ int ldb_kv_search(struct ldb_kv_context *ctx)
                        /* We accept subtree searches from a NULL base DN, ie over the whole DB */
                        ret = LDB_SUCCESS;
                }
-       } else if (ldb_dn_is_valid(req->op.search.base) == false) {
-
-               /* We don't want invalid base DNs here */
-               ldb_asprintf_errstring(ldb,
-                                      "Invalid Base DN: %s",
-                                      ldb_dn_get_linearized(req->op.search.base));
-               ret = LDB_ERR_INVALID_DN_SYNTAX;
-
        } else if (req->op.search.scope == LDB_SCOPE_BASE) {
 
                /*