s3:idmap_ldap: remove use of the ldap_idmap_alloc_context from verify_idpool().
authorMichael Adam <obnox@samba.org>
Tue, 7 Dec 2010 23:19:23 +0000 (00:19 +0100)
committerMichael Adam <obnox@samba.org>
Sun, 2 Jan 2011 11:51:54 +0000 (12:51 +0100)
Allocation is now subsumed in the idmap ldap config.
This is the beginning of the removal of the idmap ldap alloc parameters.

source3/winbindd/idmap_ldap.c

index 7b1f247c479dca55421ffec639550013a0702d9a..0b19cf92726be6359ba62b069e1d034f50e0d0ce 100644 (file)
@@ -168,11 +168,7 @@ static NTSTATUS verify_idpool(struct idmap_domain *dom)
 
        ctx = talloc_get_type(dom->private_data, struct idmap_ldap_context);
 
-       if (!ctx->alloc) {
-               return NT_STATUS_UNSUCCESSFUL;
-       }
-
-       mem_ctx = talloc_new(ctx->alloc);
+       mem_ctx = talloc_new(ctx);
        if (mem_ctx == NULL) {
                DEBUG(0, ("Out of memory!\n"));
                return NT_STATUS_NO_MEMORY;
@@ -184,8 +180,8 @@ static NTSTATUS verify_idpool(struct idmap_domain *dom)
        attr_list = get_attr_list(mem_ctx, idpool_attr_list);
        CHECK_ALLOC_DONE(attr_list);
 
-       rc = smbldap_search(ctx->alloc->smbldap_state,
-                               ctx->alloc->suffix,
+       rc = smbldap_search(ctx->smbldap_state,
+                               ctx->suffix,
                                LDAP_SCOPE_SUBTREE,
                                filter,
                                attr_list,
@@ -198,14 +194,13 @@ static NTSTATUS verify_idpool(struct idmap_domain *dom)
                return NT_STATUS_UNSUCCESSFUL;
        }
 
-       count = ldap_count_entries(ctx->alloc->smbldap_state->ldap_struct,
-                                  result);
+       count = ldap_count_entries(ctx->smbldap_state->ldap_struct, result);
 
        ldap_msgfree(result);
 
        if ( count > 1 ) {
                DEBUG(0,("Multiple entries returned from %s (base == %s)\n",
-                       filter, ctx->alloc->suffix));
+                       filter, ctx->suffix));
                ret = NT_STATUS_UNSUCCESSFUL;
                goto done;
        }
@@ -228,8 +223,8 @@ static NTSTATUS verify_idpool(struct idmap_domain *dom)
                                                    LDAP_ATTR_GIDNUMBER),
                                gid_str);
                if (mods) {
-                       rc = smbldap_modify(ctx->alloc->smbldap_state,
-                                               ctx->alloc->suffix,
+                       rc = smbldap_modify(ctx->smbldap_state,
+                                               ctx->suffix,
                                                mods);
                        ldap_mods_free(mods, True);
                } else {