r17823: get rid of most of the samdb_base_dn() calls, as they are no longer
authorAndrew Tridgell <tridge@samba.org>
Fri, 25 Aug 2006 07:08:06 +0000 (07:08 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:16:45 +0000 (14:16 -0500)
needed in searches

12 files changed:
source/auth/auth_sam.c
source/auth/sam.c
source/cldap_server/netlogon.c
source/dsdb/common/sidmap.c
source/dsdb/samdb/cracknames.c
source/dsdb/samdb/ldb_modules/samldb.c
source/dsdb/samdb/samdb.c
source/rpc_server/dssetup/dcesrv_dssetup.c
source/rpc_server/lsa/dcesrv_lsa.c
source/rpc_server/netlogon/dcerpc_netlogon.c
source/rpc_server/samr/dcesrv_samr.c
source/rpc_server/samr/samr_password.c

index 7ce2cabbf972fae0e1d1606c75d4ddef0fd081ed..ee9a308ed895f9471874eeec2c4f7dbb632b3b1f 100644 (file)
@@ -75,8 +75,6 @@ static NTSTATUS authsam_search_account(TALLOC_CTX *mem_ctx, struct ldb_context *
                }
 
                domain_dn = samdb_result_dn(mem_ctx, msgs_domain_ref[0], "nCName", NULL);
-       } else {
-               domain_dn = samdb_base_dn(mem_ctx);
        }
 
        /* pull the user attributes */
@@ -107,7 +105,7 @@ static NTSTATUS authsam_search_account(TALLOC_CTX *mem_ctx, struct ldb_context *
                }
 
                /* find the domain's DN */
-               ret = gendb_search(sam_ctx, mem_ctx, samdb_base_dn(mem_ctx), &msgs_tmp, NULL,
+               ret = gendb_search(sam_ctx, mem_ctx, NULL, &msgs_tmp, NULL,
                                   "(&(objectSid=%s)(objectclass=domain))", 
                                   ldap_encode_ndr_dom_sid(mem_ctx, domain_sid));
                if (ret == -1) {
index e7f70aa370844c42cd7183b77ee1bda574025521..f616138a3e7c435a594b1c42632b97f99fcc0459 100644 (file)
@@ -206,7 +206,7 @@ _PUBLIC_ NTSTATUS authsam_make_server_info(TALLOC_CTX *mem_ctx, struct ldb_conte
        TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx);
 
        group_ret = gendb_search(sam_ctx,
-                                tmp_ctx, samdb_base_dn(tmp_ctx), &group_msgs, group_attrs,
+                                tmp_ctx, NULL, &group_msgs, group_attrs,
                                 "(&(member=%s)(sAMAccountType=*))", 
                                 ldb_dn_linearize(tmp_ctx, msg->dn));
        if (group_ret == -1) {
index fb8040e4bc6aa742f28918f175e36e01e59807f6..16d2362d06f5637181e8fdeaed4003e60880f3ff 100644 (file)
@@ -107,7 +107,7 @@ static NTSTATUS cldapd_netlogon_fill(struct cldapd_server *cldapd,
 
        if (count == 0 && domain_guid) {
                /* OK, so no dice with the name, try and find the domain with the GUID */
-               count = gendb_search(cldapd->samctx, mem_ctx, samdb_base_dn(mem_ctx), &dom_res, dom_attrs, 
+               count = gendb_search(cldapd->samctx, mem_ctx, NULL, &dom_res, dom_attrs, 
                                   "(&(objectClass=domainDNS)(objectGUID=%s))", 
                                   domain_guid);
                if (count == 1) {
index 353d5c14f152ba8f746a115f06cfbcfc91f5c3e9..dde01fba72ec5d6e1bda06dbe2f893269c83f234 100644 (file)
@@ -103,8 +103,7 @@ static NTSTATUS sidmap_primary_domain_sid(struct sidmap_context *sidmap,
        int ret;
        struct ldb_message **res = NULL;
 
-       ret = gendb_search_dn(sidmap->samctx, mem_ctx, samdb_base_dn(mem_ctx), 
-                             &res, attrs);
+       ret = gendb_search_dn(sidmap->samctx, mem_ctx, NULL, &res, attrs);
        if (ret != 1) {
                talloc_free(res);
                return NT_STATUS_NO_SUCH_DOMAIN;
@@ -137,7 +136,7 @@ _PUBLIC_ NTSTATUS sidmap_sid_to_unixuid(struct sidmap_context *sidmap,
 
        tmp_ctx = talloc_new(sidmap);
 
-       ret = gendb_search(sidmap->samctx, tmp_ctx, samdb_base_dn(tmp_ctx), &res, attrs, 
+       ret = gendb_search(sidmap->samctx, tmp_ctx, NULL, &res, attrs, 
                           "objectSid=%s", ldap_encode_ndr_dom_sid(tmp_ctx, sid));
        if (ret != 1) {
                goto allocated_sid;
@@ -233,7 +232,7 @@ _PUBLIC_ NTSTATUS sidmap_sid_to_unixgid(struct sidmap_context *sidmap,
 
        tmp_ctx = talloc_new(sidmap);
 
-       ret = gendb_search(sidmap->samctx, tmp_ctx, samdb_base_dn(tmp_ctx), &res, attrs, 
+       ret = gendb_search(sidmap->samctx, tmp_ctx, NULL, &res, attrs, 
                           "objectSid=%s", ldap_encode_ndr_dom_sid(tmp_ctx, sid));
        if (ret != 1) {
                goto allocated_sid;
@@ -347,7 +346,7 @@ _PUBLIC_ NTSTATUS sidmap_uid_to_sid(struct sidmap_context *sidmap,
                   given uid
        */
 
-       ret = gendb_search(sidmap->samctx, tmp_ctx, samdb_base_dn(tmp_ctx), &res, attrs, 
+       ret = gendb_search(sidmap->samctx, tmp_ctx, NULL, &res, attrs, 
                           "uidNumber=%u", (unsigned int)uid);
        for (i=0;i<ret;i++) {
                if (!is_user_account(res[i])) continue;
@@ -445,7 +444,7 @@ _PUBLIC_ NTSTATUS sidmap_gid_to_sid(struct sidmap_context *sidmap,
                   given gid
        */
 
-       ret = gendb_search(sidmap->samctx, tmp_ctx, samdb_base_dn(tmp_ctx), &res, attrs, 
+       ret = gendb_search(sidmap->samctx, tmp_ctx, NULL, &res, attrs, 
                           "gidNumber=%u", (unsigned int)gid);
        for (i=0;i<ret;i++) {
                if (!is_group_account(res[i])) continue;
@@ -465,7 +464,7 @@ _PUBLIC_ NTSTATUS sidmap_gid_to_sid(struct sidmap_context *sidmap,
                goto allocate_sid;
        }
 
-       ret = gendb_search(sidmap->samctx, tmp_ctx, samdb_base_dn(tmp_ctx), &res, attrs, 
+       ret = gendb_search(sidmap->samctx, tmp_ctx, NULL, &res, attrs, 
                           "(|(unixName=%s)(sAMAccountName=%s))", 
                           grp->gr_name, grp->gr_name);
        for (i=0;i<ret;i++) {
index b755aeef32205b621fa82f4c768a31387070a8aa..e8fd1fa71b321cf73d3d626060336e783682cbc7 100644 (file)
@@ -69,7 +69,7 @@ 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(tmp_ctx),
+       service_dn = ldb_dn_string_compose(tmp_ctx, NULL,
                                           "CN=Directory Service,CN=Windows NT"
                                           ",CN=Services,CN=Configuration");
        service_dn_str = ldb_dn_linearize(tmp_ctx, service_dn);
@@ -578,7 +578,6 @@ static WERROR DsCrackNameOneFilter(struct ldb_context *sam_ctx, TALLOC_CTX *mem_
        struct ldb_message **result_res = NULL;
        const struct ldb_dn *result_basedn;
        const struct ldb_dn *partitions_basedn = ldb_dn_string_compose(mem_ctx, samdb_base_dn(mem_ctx), "CN=Partitions,CN=Configuration");
-       const struct ldb_dn *basedn = samdb_base_dn(mem_ctx);
 
        const char * const _domain_attrs_1779[] = { "ncName", "dnsRoot", NULL};
        const char * const _result_attrs_null[] = { NULL };
@@ -737,7 +736,7 @@ static WERROR DsCrackNameOneFilter(struct ldb_context *sam_ctx, TALLOC_CTX *mem_
                                return WERR_OK;
                        }
                        dom_sid->num_auths--;
-                       ldb_ret = gendb_search(sam_ctx, mem_ctx, basedn, &domain_res, attrs,
+                       ldb_ret = gendb_search(sam_ctx, mem_ctx, NULL, &domain_res, attrs,
                                               "(&(objectSid=%s)(objectClass=domain))", ldap_encode_ndr_dom_sid(mem_ctx, dom_sid));
                        if (ldb_ret != 1) {
                                info1->status = DRSUAPI_DS_NAME_STATUS_NOT_FOUND;
index 98acc2696f6ed76f23e1786d2558b4376afa4328..8cf865bd3efd71f8460733491e419b15d6ff892d 100644 (file)
@@ -301,7 +301,7 @@ int samldb_notice_sid(struct ldb_module *module,
        filter = talloc_asprintf(mem_ctx, "(objectSid=%s)",
                                 ldap_encode_ndr_dom_sid(mem_ctx, sid));
 
-       ret = ldb_search(module->ldb, samdb_base_dn(mem_ctx), LDB_SCOPE_SUBTREE, filter, attrs, &res);
+       ret = ldb_search(module->ldb, NULL, LDB_SCOPE_SUBTREE, filter, attrs, &res);
        if (ret == LDB_SUCCESS) {
                if (res->count > 0) {
                        talloc_free(res);
@@ -333,7 +333,7 @@ int samldb_notice_sid(struct ldb_module *module,
        filter = talloc_asprintf(mem_ctx, "(&(objectSid=%s)(objectclass=domain))",
                                 ldap_encode_ndr_dom_sid(mem_ctx, dom_sid));
 
-       ret = ldb_search(module->ldb, samdb_base_dn(mem_ctx), LDB_SCOPE_SUBTREE, filter, attrs, &dom_res);
+       ret = ldb_search(module->ldb, NULL, LDB_SCOPE_SUBTREE, filter, attrs, &dom_res);
        if (ret == LDB_SUCCESS) {
                talloc_steal(mem_ctx, dom_res);
                if (dom_res->count == 0) {
index a48e21f52d323bd99dde464da035e1893916b26c..4027203b24ea6742833994a7b7ba336dea07f2cd 100644 (file)
@@ -1024,7 +1024,7 @@ struct security_descriptor *samdb_default_security_descriptor(TALLOC_CTX *mem_ct
        return sd;
 }
 
-struct ldb_dn *samdb_base_dn(TALLOC_CTX *mem_ctx) 
+const struct ldb_dn *samdb_base_dn(TALLOC_CTX *mem_ctx) 
 {
        TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx);
        int server_role = lp_server_role();
@@ -1217,7 +1217,7 @@ _PUBLIC_ NTSTATUS samdb_set_password(struct ldb_context *ctx, TALLOC_CTX *mem_ct
                        return NT_STATUS_INTERNAL_DB_CORRUPTION;
                }
 
-               count = gendb_search(ctx, mem_ctx, samdb_base_dn(mem_ctx), &res, domain_attrs, 
+               count = gendb_search(ctx, mem_ctx, NULL, &res, domain_attrs, 
                                     "(objectSid=%s)", 
                                     ldap_encode_ndr_dom_sid(mem_ctx, domain_sid));
                if (count != 1) {
@@ -1397,7 +1397,7 @@ _PUBLIC_ NTSTATUS samdb_set_password_sid(struct ldb_context *ctx, TALLOC_CTX *me
                return NT_STATUS_TRANSACTION_ABORTED;
        }
 
-       user_dn = samdb_search_dn(ctx, mem_ctx, samdb_base_dn(mem_ctx)
+       user_dn = samdb_search_dn(ctx, mem_ctx, NULL
                                  "(&(objectSid=%s)(objectClass=user))", 
                                  ldap_encode_ndr_dom_sid(mem_ctx, user_sid));
        if (!user_dn) {
@@ -1548,7 +1548,7 @@ NTSTATUS samdb_create_foreign_security_principal(struct ldb_context *sam_ctx, TA
         * cn=For...,cn=Builtin,dc={BASEDN}.  -- vl
         */
        
-       basedn = samdb_search_dn(sam_ctx, mem_ctx, samdb_base_dn(mem_ctx),
+       basedn = samdb_search_dn(sam_ctx, mem_ctx, NULL,
                                 "(&(objectClass=container)(cn=ForeignSecurityPrincipals))");
        
        if (basedn == NULL) {
index 9bd8be322350d027d8b984cd348810389baefb5e..5d627c60fd9c7f2591092ddca55245093d380f6d 100644 (file)
@@ -88,7 +88,7 @@ static WERROR dssetup_DsRoleGetPrimaryDomainInformation(struct dcesrv_call_state
                                return WERR_SERVER_UNAVAILABLE;
                        }
 
-                       ret = gendb_search_dn(sam_ctx, mem_ctx, samdb_base_dn(mem_ctx), &res, attrs);
+                       ret = gendb_search_dn(sam_ctx, mem_ctx, NULL, &res, attrs);
                        if (ret != 1) {
                                return WERR_SERVER_UNAVAILABLE;
                        }
index 860f6e5c799c67b24b3b91a2a3a1147a6b8c72e9..7949ee2a93671c258fc9f32ccf7359fd7912ab1b 100644 (file)
@@ -563,7 +563,7 @@ static NTSTATUS lsa_EnumAccounts(struct dcesrv_call_state *dce_call, TALLOC_CTX
        /* NOTE: This call must only return accounts that have at least
           one privilege set 
        */
-       ret = gendb_search(state->sam_ldb, mem_ctx, samdb_base_dn(mem_ctx), &res, attrs, 
+       ret = gendb_search(state->sam_ldb, mem_ctx, NULL, &res, attrs, 
                           "(&(objectSid=*)(privilege=*))");
        if (ret < 0) {
                return NT_STATUS_NO_SUCH_USER;
@@ -1428,7 +1428,7 @@ static NTSTATUS lsa_EnumPrivsAccount(struct dcesrv_call_state *dce_call,
                return NT_STATUS_NO_MEMORY;
        }
 
-       ret = gendb_search(astate->policy->sam_ldb, mem_ctx, samdb_base_dn(mem_ctx), &res, attrs, 
+       ret = gendb_search(astate->policy->sam_ldb, mem_ctx, NULL, &res, attrs, 
                           "objectSid=%s", sidstr);
        if (ret != 1) {
                return NT_STATUS_OK;
@@ -1484,7 +1484,7 @@ static NTSTATUS lsa_EnumAccountRights(struct dcesrv_call_state *dce_call,
                return NT_STATUS_NO_MEMORY;
        }
 
-       ret = gendb_search(state->sam_ldb, mem_ctx, samdb_base_dn(mem_ctx), &res, attrs, 
+       ret = gendb_search(state->sam_ldb, mem_ctx, NULL, &res, attrs, 
                           "(&(objectSid=%s)(privilege=*))", sidstr);
        if (ret == 0) {
                return NT_STATUS_OBJECT_NAME_NOT_FOUND;
@@ -1547,7 +1547,7 @@ static NTSTATUS lsa_AddRemoveAccountRights(struct dcesrv_call_state *dce_call,
        }
 
        msg->dn = samdb_search_dn(state->sam_ldb, mem_ctx, 
-                                 samdb_base_dn(mem_ctx), "objectSid=%s", sidstr);
+                                 NULL, "objectSid=%s", sidstr);
        if (msg->dn == NULL) {
                NTSTATUS status;
                if (ldb_flag == LDB_FLAG_MOD_DELETE) {
@@ -2413,7 +2413,7 @@ static NTSTATUS lsa_EnumAccountsWithUserRight(struct dcesrv_call_state *dce_call
                return NT_STATUS_NO_SUCH_PRIVILEGE;
        }
 
-       ret = gendb_search(state->sam_ldb, mem_ctx, samdb_base_dn(mem_ctx), &res, attrs, 
+       ret = gendb_search(state->sam_ldb, mem_ctx, NULL, &res, attrs, 
                           "privilege=%s", privname);
        if (ret == -1) {
                return NT_STATUS_INTERNAL_DB_CORRUPTION;
index 569ec9f2b3eafca07188c53e5ab97f0d88611a17..74a70e8bcf111889347052e3261f55b0a1a0dc8a 100644 (file)
@@ -97,7 +97,7 @@ static NTSTATUS netr_ServerAuthenticate3(struct dcesrv_call_state *dce_call, TAL
                return NT_STATUS_INVALID_SYSTEM_SERVICE;
        }
        /* pull the user attributes */
-       num_records = gendb_search(sam_ctx, mem_ctx, samdb_base_dn(mem_ctx), &msgs, attrs,
+       num_records = gendb_search(sam_ctx, mem_ctx, NULL, &msgs, attrs,
                                   "(&(sAMAccountName=%s)(objectclass=user))", 
                                   r->in.account_name);
 
@@ -909,7 +909,7 @@ static NTSTATUS netr_LogonGetDomainInfo(struct dcesrv_call_state *dce_call, TALL
           primary domain is also a "trusted" domain, so we need to
           put the primary domain into the lists of returned trusts as
           well */
-       ret1 = gendb_search(sam_ctx, mem_ctx, samdb_base_dn(mem_ctx), &res1, attrs, "(objectClass=domainDNS)");
+       ret1 = gendb_search(sam_ctx, mem_ctx, NULL, &res1, attrs, "(objectClass=domainDNS)");
        if (ret1 != 1) {
                return NT_STATUS_INTERNAL_DB_CORRUPTION;
        }
@@ -925,7 +925,7 @@ static NTSTATUS netr_LogonGetDomainInfo(struct dcesrv_call_state *dce_call, TALL
 
        local_domain = samdb_result_string(ref_res[0], "nETBIOSName", NULL);
 
-       ret2 = gendb_search(sam_ctx, mem_ctx, samdb_base_dn(mem_ctx), &res2, attrs, "(objectClass=trustedDomain)");
+       ret2 = gendb_search(sam_ctx, mem_ctx, NULL, &res2, attrs, "(objectClass=trustedDomain)");
        if (ret2 == -1) {
                return NT_STATUS_INTERNAL_DB_CORRUPTION;
        }
@@ -1152,7 +1152,7 @@ static WERROR netr_DsrEnumerateDomainTrusts(struct dcesrv_call_state *dce_call,
                return WERR_GENERAL_FAILURE;
        }
 
-       ret = gendb_search_dn(sam_ctx, mem_ctx, samdb_base_dn(mem_ctx), &dom_res, dom_attrs);
+       ret = gendb_search_dn(sam_ctx, mem_ctx, NULL, &dom_res, dom_attrs);
        if (ret == -1) {
                return WERR_GENERAL_FAILURE;            
        }
index b3dadd14e17dd1f690d5bac11ed60ebbcfbfad37..65a1491a1db9fa59855bafe73efa8b26498ba60b 100644 (file)
@@ -239,7 +239,7 @@ static NTSTATUS samr_LookupDomain(struct dcesrv_call_state *dce_call, TALLOC_CTX
 
        if (strcasecmp(r->in.domain_name->string, "BUILTIN") == 0) {
                ret = gendb_search(c_state->sam_ctx,
-                                  mem_ctx, samdb_base_dn(mem_ctx), &dom_msgs, dom_attrs,
+                                  mem_ctx, NULL, &dom_msgs, dom_attrs,
                                   "(objectClass=builtinDomain)");
        } else {
                ret = gendb_search(c_state->sam_ctx,
@@ -300,7 +300,7 @@ static NTSTATUS samr_EnumDomains(struct dcesrv_call_state *dce_call, TALLOC_CTX
        c_state = h->data;
 
        count = gendb_search(c_state->sam_ctx,
-                            mem_ctx, samdb_base_dn(mem_ctx), &dom_msgs, dom_attrs,
+                            mem_ctx, NULL, &dom_msgs, dom_attrs,
                             "(objectClass=domain)");
        if (count == -1) {
                DEBUG(0,("samdb: no domains found in EnumDomains\n"));
@@ -380,7 +380,7 @@ static NTSTATUS samr_OpenDomain(struct dcesrv_call_state *dce_call, TALLOC_CTX *
        }
 
        ret = gendb_search(c_state->sam_ctx,
-                          mem_ctx, samdb_base_dn(mem_ctx), &dom_msgs, dom_attrs,
+                          mem_ctx, NULL, &dom_msgs, dom_attrs,
                           "(&(objectSid=%s)(&(objectclass=domain)))",
                           ldap_encode_ndr_dom_sid(mem_ctx, r->in.sid));
        if (ret != 1) {
@@ -1124,7 +1124,7 @@ static NTSTATUS samr_CreateUser2(struct dcesrv_call_state *dce_call, TALLOC_CTX
        }
 
        /* check if the user already exists */
-       name = samdb_search_string(d_state->sam_ctx, mem_ctx, samdb_base_dn(mem_ctx)
+       name = samdb_search_string(d_state->sam_ctx, mem_ctx, NULL
                                   "sAMAccountName", 
                                   "(&(sAMAccountName=%s)(objectclass=user))", 
                                   ldb_binary_encode_string(mem_ctx, account_name));
@@ -1631,7 +1631,7 @@ static NTSTATUS samr_GetAliasMembership(struct dcesrv_call_state *dce_call, TALL
 
                        memberdn = 
                                samdb_search_string(d_state->sam_ctx,
-                                                   mem_ctx, samdb_base_dn(mem_ctx), "distinguishedName",
+                                                   mem_ctx, NULL, "distinguishedName",
                                                    "(objectSid=%s)",
                                                    ldap_encode_ndr_dom_sid(mem_ctx, 
                                                                            r->in.sids->sids[i].sid));
@@ -2534,7 +2534,7 @@ static NTSTATUS samr_AddAliasMember(struct dcesrv_call_state *dce_call, TALLOC_C
        a_state = h->data;
        d_state = a_state->domain_state;
 
-       ret = gendb_search(d_state->sam_ctx, mem_ctx, samdb_base_dn(mem_ctx),
+       ret = gendb_search(d_state->sam_ctx, mem_ctx, NULL,
                           &msgs, attrs, "(objectsid=%s)", 
                           ldap_encode_ndr_dom_sid(mem_ctx, r->in.sid));
 
@@ -2594,7 +2594,7 @@ static NTSTATUS samr_DeleteAliasMember(struct dcesrv_call_state *dce_call, TALLO
        a_state = h->data;
        d_state = a_state->domain_state;
 
-       memberdn = samdb_search_string(d_state->sam_ctx, mem_ctx, samdb_base_dn(mem_ctx),
+       memberdn = samdb_search_string(d_state->sam_ctx, mem_ctx, NULL,
                                       "distinguishedName", "(objectSid=%s)", 
                                       ldap_encode_ndr_dom_sid(mem_ctx, r->in.sid));
 
@@ -3928,7 +3928,7 @@ static NTSTATUS samr_GetDomPwInfo(struct dcesrv_call_state *dce_call, TALLOC_CTX
 
        /* The domain name in this call is ignored */
        ret = gendb_search_dn(sam_ctx, 
-                          mem_ctx, samdb_base_dn(mem_ctx), &msgs, attrs);
+                          mem_ctx, NULL, &msgs, attrs);
        if (ret <= 0) {
                return NT_STATUS_NO_SUCH_DOMAIN;
        }
index d879b09f4de841ea667bc995eb1b19f89d52f424..3a94270b739b4895779ac13b11a114176a35c6b4 100644 (file)
@@ -216,7 +216,7 @@ NTSTATUS samr_OemChangePasswordUser2(struct dcesrv_call_state *dce_call, TALLOC_
           user SID). We also need the current lm password hash in
           order to decrypt the incoming password */
        ret = gendb_search(sam_ctx, 
-                          mem_ctx, samdb_base_dn(mem_ctx), &res, attrs,
+                          mem_ctx, NULL, &res, attrs,
                           "(&(sAMAccountName=%s)(objectclass=user))",
                           r->in.account->string);
        if (ret != 1) {
@@ -356,7 +356,7 @@ NTSTATUS samr_ChangePasswordUser3(struct dcesrv_call_state *dce_call,
           user SID). We also need the current lm and nt password hashes
           in order to decrypt the incoming passwords */
        ret = gendb_search(sam_ctx, 
-                          mem_ctx, samdb_base_dn(mem_ctx), &res, attrs,
+                          mem_ctx, NULL, &res, attrs,
                           "(&(sAMAccountName=%s)(objectclass=user))",
                           r->in.account->string);
        if (ret != 1) {