r13282: Indentation, and ensure we handle the talloc_free in the right place
authorAndrew Bartlett <abartlet@samba.org>
Wed, 1 Feb 2006 10:04:55 +0000 (10:04 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:51:42 +0000 (13:51 -0500)
all the time.

Andrew Bartlett
(This used to be commit 2aa9fefbb30959f29e9d5a79c4880f33a747b68c)

source4/dsdb/samdb/cracknames.c

index 8cc95e503cd7ac536631eda4bbe1406273fecd25..d886894483139c9e966cc93aecebefe162541447 100644 (file)
@@ -66,9 +66,9 @@ static enum drsuapi_DsNameStatus LDB_lookup_spn_alias(krb5_context context, stru
                return DRSUAPI_DS_NAME_STATUS_RESOLVE_ERROR;
        }
 
-       service_dn = ldb_dn_string_compose(tmp_ctx, samdb_base_dn(mem_ctx),
-                                               "CN=Directory Service,CN=Windows NT"
-                                               ",CN=Services,CN=Configuration");
+       service_dn = ldb_dn_string_compose(tmp_ctx, samdb_base_dn(tmp_ctx),
+                                          "CN=Directory Service,CN=Windows NT"
+                                          ",CN=Services,CN=Configuration");
        service_dn_str = ldb_dn_linearize(tmp_ctx, service_dn);
 
        ret = ldb_search(ldb_ctx, service_dn, LDB_SCOPE_BASE, "(objectClass=nTDSService)",
@@ -77,7 +77,7 @@ static enum drsuapi_DsNameStatus LDB_lookup_spn_alias(krb5_context context, stru
        if (ret != LDB_SUCCESS) {
                DEBUG(1, ("ldb_search: dn: %s not found: %s", service_dn_str, ldb_errstring(ldb_ctx)));
                return DRSUAPI_DS_NAME_STATUS_RESOLVE_ERROR;
-       } else if (res->count > 1) {
+       } else if (res->count != 1) {
                talloc_free(res);
                DEBUG(1, ("ldb_search: dn: %s found %d times!", service_dn_str, res->count));
                return DRSUAPI_DS_NAME_STATUS_NOT_FOUND;