diff options
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/ranged_results.c | 6 | ||||
-rwxr-xr-x | testprogs/ejs/ldap.js | 18 |
2 files changed, 13 insertions, 11 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/ranged_results.c b/source4/dsdb/samdb/ldb_modules/ranged_results.c index 345b8b8440..c527afc6db 100644 --- a/source4/dsdb/samdb/ldb_modules/ranged_results.c +++ b/source4/dsdb/samdb/ldb_modules/ranged_results.c @@ -153,8 +153,10 @@ static int rr_search(struct ldb_module *module, struct ldb_request *req) if (strncasecmp(p, ";range=", strlen(";range=")) != 0) { continue; } - if (sscanf(p, ";range=%u-*", &start) == 1) { - } else if (sscanf(p, ";range=%u-%u", &start, &end) != 2) { + if (sscanf(p, ";range=%u-%u", &start, &end) == 2) { + } else if (sscanf(p, ";range=%u-*", &start) == 1) { + end = (unsigned int)-1; + } else { ldb_asprintf_errstring(module->ldb, "range request error: range requst malformed"); return LDB_ERR_UNWILLING_TO_PERFORM; } diff --git a/testprogs/ejs/ldap.js b/testprogs/ejs/ldap.js index 836b726ad9..090f93b6ca 100755 --- a/testprogs/ejs/ldap.js +++ b/testprogs/ejs/ldap.js @@ -240,7 +240,7 @@ servicePrincipalName: host/ldaptest2computer29 var attrs = new Array("servicePrincipalName;range=0-*"); var res = ldb.search("(cn=ldaptest2computer))", base_dn, ldb.SCOPE_SUBTREE, attrs); if (res.error != 0 || res.msgs.length != 1) { - println("Could not find (cn=ldaptest2computer)"); + println("Could not find (cn=ldaptest2computer) for servicePrincipalName;range=0-*"); assert(res.error == 0); assert(res.msgs.length == 1); } @@ -250,7 +250,7 @@ servicePrincipalName: host/ldaptest2computer29 var attrs = new Array("servicePrincipalName;range=0-19"); var res = ldb.search("(cn=ldaptest2computer))", base_dn, ldb.SCOPE_SUBTREE, attrs); if (res.error != 0 || res.msgs.length != 1) { - println("Could not find (cn=ldaptest2computer)"); + println("Could not find (cn=ldaptest2computer) for servicePrincipalName;range=0-19"); assert(res.error == 0); assert(res.msgs.length == 1); } @@ -260,7 +260,7 @@ servicePrincipalName: host/ldaptest2computer29 var attrs = new Array("servicePrincipalName;range=0-30"); var res = ldb.search("(cn=ldaptest2computer))", base_dn, ldb.SCOPE_SUBTREE, attrs); if (res.error != 0 || res.msgs.length != 1) { - println("Could not find (cn=ldaptest2computer)"); + println("Could not find (cn=ldaptest2computer) at servicePrincipalName;range=0-19"); assert(res.error == 0); assert(res.msgs.length == 1); } @@ -269,7 +269,7 @@ servicePrincipalName: host/ldaptest2computer29 var attrs = new Array("servicePrincipalName;range=0-40"); var res = ldb.search("(cn=ldaptest2computer))", base_dn, ldb.SCOPE_SUBTREE, attrs); if (res.error != 0 || res.msgs.length != 1) { - println("Could not find (cn=ldaptest2computer)"); + println("Could not find (cn=ldaptest2computer) at servicePrincipalName;range=0-40"); assert(res.error == 0); assert(res.msgs.length == 1); } @@ -278,7 +278,7 @@ servicePrincipalName: host/ldaptest2computer29 var attrs = new Array("servicePrincipalName;range=30-40"); var res = ldb.search("(cn=ldaptest2computer))", base_dn, ldb.SCOPE_SUBTREE, attrs); if (res.error != 0 || res.msgs.length != 1) { - println("Could not find (cn=ldaptest2computer)"); + println("Could not find (cn=ldaptest2computer) at servicePrincipalName;range=30-40"); assert(res.error == 0); assert(res.msgs.length == 1); } @@ -287,7 +287,7 @@ servicePrincipalName: host/ldaptest2computer29 var attrs = new Array("servicePrincipalName;range=10-40"); var res = ldb.search("(cn=ldaptest2computer))", base_dn, ldb.SCOPE_SUBTREE, attrs); if (res.error != 0 || res.msgs.length != 1) { - println("Could not find (cn=ldaptest2computer)"); + println("Could not find (cn=ldaptest2computer) at servicePrincipalName;range=10-40"); assert(res.error == 0); assert(res.msgs.length == 1); } @@ -297,7 +297,7 @@ servicePrincipalName: host/ldaptest2computer29 var attrs = new Array("servicePrincipalName;range=11-40"); var res = ldb.search("(cn=ldaptest2computer))", base_dn, ldb.SCOPE_SUBTREE, attrs); if (res.error != 0 || res.msgs.length != 1) { - println("Could not find (cn=ldaptest2computer)"); + println("Could not find (cn=ldaptest2computer) at servicePrincipalName;range=10-*"); assert(res.error == 0); assert(res.msgs.length == 1); } @@ -309,7 +309,7 @@ servicePrincipalName: host/ldaptest2computer29 var attrs = new Array("servicePrincipalName;range=11-15"); var res = ldb.search("(cn=ldaptest2computer))", base_dn, ldb.SCOPE_SUBTREE, attrs); if (res.error != 0 || res.msgs.length != 1) { - println("Could not find (cn=ldaptest2computer)"); + println("Could not find (cn=ldaptest2computer) at servicePrincipalName;range=11-15"); assert(res.error == 0); assert(res.msgs.length == 1); } @@ -319,7 +319,7 @@ servicePrincipalName: host/ldaptest2computer29 var attrs = new Array("servicePrincipalName"); var res = ldb.search("(cn=ldaptest2computer))", base_dn, ldb.SCOPE_SUBTREE, attrs); if (res.error != 0 || res.msgs.length != 1) { - println("Could not find (cn=ldaptest2computer)"); + println("Could not find (cn=ldaptest2computer) at servicePrincipalName"); assert(res.error == 0); assert(res.msgs.length == 1); } |