Revert "s3-winbindd: make sure we obey the -n switch also for samlogon cache access."
[obnox/samba/samba-obnox.git] / source3 / winbindd / winbindd_msrpc.c
index 42879f265309db439a1abeb416be3750b147bb99..39186f882574dc7306bbee0549ea515f7037ad37 100644 (file)
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_WINBIND
 
+static NTSTATUS winbindd_lookup_names(TALLOC_CTX *mem_ctx,
+                                     struct winbindd_domain *domain,
+                                     uint32_t num_names,
+                                     const char **names,
+                                     const char ***domains,
+                                     struct dom_sid **sids,
+                                     enum lsa_SidType **types);
 
 /* Query display info for a domain.  This returns enough information plus a
    bit extra to give an overview of domain users for the User Manager
@@ -247,7 +254,7 @@ static NTSTATUS msrpc_name_to_sid(struct winbindd_domain *domain,
        name_map_status = normalize_name_unmap(mem_ctx, full_name,
                                               &mapped_name);
 
-       /* Reset the full_name pointer if we mapped anytthing */
+       /* Reset the full_name pointer if we mapped anything */
 
        if (NT_STATUS_IS_OK(name_map_status) ||
            NT_STATUS_EQUAL(name_map_status, NT_STATUS_FILE_RENAMED))
@@ -342,7 +349,7 @@ static NTSTATUS msrpc_rids_to_names(struct winbindd_domain *domain,
        DEBUG(3, ("msrpc_rids_to_names: domain %s\n", domain->name ));
 
        if (num_rids) {
-               sids = TALLOC_ARRAY(mem_ctx, struct dom_sid, num_rids);
+               sids = talloc_array(mem_ctx, struct dom_sid, num_rids);
                if (sids == NULL) {
                        return NT_STATUS_NO_MEMORY;
                }
@@ -699,9 +706,9 @@ static NTSTATUS msrpc_lookup_groupmem(struct winbindd_domain *domain,
 
 #define MAX_LOOKUP_RIDS 900
 
-        *names = TALLOC_ZERO_ARRAY(mem_ctx, char *, *num_names);
-        *name_types = TALLOC_ZERO_ARRAY(mem_ctx, uint32, *num_names);
-        *sid_mem = TALLOC_ZERO_ARRAY(mem_ctx, struct dom_sid, *num_names);
+        *names = talloc_zero_array(mem_ctx, char *, *num_names);
+        *name_types = talloc_zero_array(mem_ctx, uint32, *num_names);
+        *sid_mem = talloc_zero_array(mem_ctx, struct dom_sid, *num_names);
 
        for (j=0;j<(*num_names);j++)
                sid_compose(&(*sid_mem)[j], &domain->sid, rid_mem[j]);
@@ -760,7 +767,7 @@ static NTSTATUS msrpc_lookup_groupmem(struct winbindd_domain *domain,
 
 #ifdef HAVE_LDAP
 
-#include <ldap.h>
+#include "ads.h"
 
 static int get_ldap_seq(const char *server, struct sockaddr_storage *ss, int port, uint32 *seq)
 {
@@ -1154,13 +1161,13 @@ typedef NTSTATUS (*lookup_names_fn_t)(struct dcerpc_binding_handle *h,
                                      enum lsa_SidType **types,
                                      NTSTATUS *result);
 
-NTSTATUS winbindd_lookup_names(TALLOC_CTX *mem_ctx,
-                              struct winbindd_domain *domain,
-                              uint32_t num_names,
-                              const char **names,
-                              const char ***domains,
-                              struct dom_sid **sids,
-                              enum lsa_SidType **types)
+static NTSTATUS winbindd_lookup_names(TALLOC_CTX *mem_ctx,
+                                     struct winbindd_domain *domain,
+                                     uint32_t num_names,
+                                     const char **names,
+                                     const char ***domains,
+                                     struct dom_sid **sids,
+                                     enum lsa_SidType **types)
 {
        NTSTATUS status;
        NTSTATUS result;