s3: Remove unused get_sam_group_entries
authorVolker Lendecke <vl@samba.org>
Mon, 21 Dec 2009 14:02:56 +0000 (15:02 +0100)
committerVolker Lendecke <vl@samba.org>
Mon, 21 Dec 2009 15:27:19 +0000 (16:27 +0100)
source3/winbindd/winbindd_group.c
source3/winbindd/winbindd_proto.h

index 389dd2e2e2f679cffb60a4e558857cfe2bbfc58c..a985fa254fedbc7bb608765fccf27afbc00ca9c0 100644 (file)
@@ -66,141 +66,6 @@ bool fill_grent(TALLOC_CTX *mem_ctx, struct winbindd_gr *gr,
        return True;
 }
 
-/* Get the list of domain groups and domain aliases for a domain.  We fill in
-   the sam_entries and num_sam_entries fields with domain group information.
-   Return True if some groups were returned, False otherwise. */
-
-bool get_sam_group_entries(struct getent_state *ent)
-{
-       NTSTATUS status;
-       uint32 num_entries;
-       struct acct_info *name_list = NULL;
-       TALLOC_CTX *mem_ctx;
-       bool result = False;
-       struct acct_info *sam_grp_entries = NULL;
-       struct winbindd_domain *domain;
-
-       if (ent->got_sam_entries)
-               return False;
-
-       if (!(mem_ctx = talloc_init("get_sam_group_entries(%s)",
-                                         ent->domain_name))) {
-               DEBUG(1, ("get_sam_group_entries: "
-                         "could not create talloc context!\n"));
-               return False;
-       }
-
-       /* Free any existing group info */
-
-       SAFE_FREE(ent->sam_entries);
-       ent->num_sam_entries = 0;
-       ent->got_sam_entries = True;
-
-       /* Enumerate domain groups */
-
-       num_entries = 0;
-
-       if (!(domain = find_domain_from_name(ent->domain_name))) {
-               DEBUG(3, ("no such domain %s in get_sam_group_entries\n",
-                         ent->domain_name));
-               goto done;
-       }
-
-       /* always get the domain global groups */
-
-       status = domain->methods->enum_dom_groups(domain, mem_ctx, &num_entries,
-                                                 &sam_grp_entries);
-
-       if (!NT_STATUS_IS_OK(status)) {
-               DEBUG(3, ("get_sam_group_entries: "
-                         "could not enumerate domain groups! Error: %s\n",
-                         nt_errstr(status)));
-               result = False;
-               goto done;
-       }
-
-       /* Copy entries into return buffer */
-
-       if (num_entries) {
-               name_list = SMB_MALLOC_ARRAY(struct acct_info, num_entries);
-               if (!name_list) {
-                       DEBUG(0,("get_sam_group_entries: Failed to malloc "
-                                "memory for %d domain groups!\n",
-                                num_entries));
-                       result = False;
-                       goto done;
-               }
-               memcpy(name_list, sam_grp_entries,
-                       num_entries * sizeof(struct acct_info));
-       }
-
-       ent->num_sam_entries = num_entries;
-
-       /* get the domain local groups if we are a member of a native win2k
-        * domain and are not using LDAP to get the groups */
-
-       if ( ( lp_security() != SEC_ADS && domain->native_mode
-               && domain->primary) || domain->internal )
-       {
-               DEBUG(4,("get_sam_group_entries: %s domain; "
-                        "enumerating local groups as well\n",
-                        domain->native_mode ? "Native Mode 2k":
-                                               "BUILTIN or local"));
-
-               status = domain->methods->enum_local_groups(domain, mem_ctx,
-                                                           &num_entries,
-                                                           &sam_grp_entries);
-
-               if ( !NT_STATUS_IS_OK(status) ) {
-                       DEBUG(3,("get_sam_group_entries: "
-                               "Failed to enumerate "
-                               "domain local groups with error %s!\n",
-                               nt_errstr(status)));
-                       num_entries = 0;
-               }
-               else
-                       DEBUG(4,("get_sam_group_entries: "
-                                "Returned %d local groups\n",
-                                num_entries));
-
-               /* Copy entries into return buffer */
-
-               if ( num_entries ) {
-                       name_list = SMB_REALLOC_ARRAY(name_list,
-                                                     struct acct_info,
-                                                     ent->num_sam_entries+
-                                                       num_entries);
-                       if (!name_list) {
-                               DEBUG(0,("get_sam_group_entries: "
-                                        "Failed to realloc more memory "
-                                        "for %d local groups!\n",
-                                        num_entries));
-                               result = False;
-                               goto done;
-                       }
-
-                       memcpy(&name_list[ent->num_sam_entries],
-                               sam_grp_entries,
-                               num_entries * sizeof(struct acct_info));
-               }
-
-               ent->num_sam_entries += num_entries;
-       }
-
-
-       /* Fill in remaining fields */
-
-       ent->sam_entries = name_list;
-       ent->sam_entry_index = 0;
-
-       result = (ent->num_sam_entries > 0);
-
- done:
-       talloc_destroy(mem_ctx);
-
-       return result;
-}
-
 struct getgr_countmem {
        int num;
        size_t len;
index 98f3ebd7e1006b84ed03298c871528d3adcdc661..97c7c6fb6a3e7961c0a640944db10495639becaf 100644 (file)
@@ -351,7 +351,6 @@ void winbindd_getgroups(struct winbindd_cli_state *state);
 void winbindd_getusersids(struct winbindd_cli_state *state);
 void winbindd_getuserdomgroups(struct winbindd_cli_state *state);
 void winbindd_getsidaliases(struct winbindd_cli_state *state);
-bool get_sam_group_entries(struct getent_state *ent);
 bool fill_grent(TALLOC_CTX *mem_ctx, struct winbindd_gr *gr,
                const char *dom_name, const char *gr_name, gid_t unix_gid);
 NTSTATUS winbindd_print_groupmembers(struct talloc_dict *members,