summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2007-07-05 19:55:40 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:23:49 -0500
commita6706eee9b0ac1ee8c55f1e7c0f43bc0f50ae4b9 (patch)
treec3421ae15020c408126f93e755067528cedf1c6f
parent35d09869edf09b2af394a3eea1ee7b9ef1ba696b (diff)
downloadsamba-a6706eee9b0ac1ee8c55f1e7c0f43bc0f50ae4b9.tar.gz
samba-a6706eee9b0ac1ee8c55f1e7c0f43bc0f50ae4b9.tar.bz2
samba-a6706eee9b0ac1ee8c55f1e7c0f43bc0f50ae4b9.zip
r23730: Squashed commit of the following:
commit 3941269fa01038fca242a197e8d7c1f234d45ea7 Author: Gerald (Jerry) Carter <jerry@samba.org> Date: Thu Jul 5 14:52:03 2007 -0500 Two fixes for "winbind expand groups". (a) Update the counter for the number of new groups to resolve else we'll only expand one group member per level and drop the rest. (b) Don't reset the num_names counter in winbindd_ads.c:lookup_groupmem() or we'll drop the SIDs resolved to names via cache from the resulting list. (This used to be commit dfb89dfcaa02f497ff22ac0213b70add6e4d5b8f)
-rw-r--r--source3/nsswitch/winbindd_ads.c7
-rw-r--r--source3/nsswitch/winbindd_group.c1
2 files changed, 6 insertions, 2 deletions
diff --git a/source3/nsswitch/winbindd_ads.c b/source3/nsswitch/winbindd_ads.c
index 6f1db55c62..09289912f9 100644
--- a/source3/nsswitch/winbindd_ads.c
+++ b/source3/nsswitch/winbindd_ads.c
@@ -1017,7 +1017,11 @@ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain,
DEBUG(10,("ads: lookup_groupmem: got sid %s from cache\n",
sid_string_static(&sid)));
sid_copy(&(*sid_mem)[*num_names], &sid);
- (*names)[*num_names] = CONST_DISCARD(char *,name);
+ (*names)[*num_names] = talloc_asprintf(*names, "%s%c%s",
+ domain_name,
+ *lp_winbind_separator(),
+ name );
+
(*name_types)[*num_names] = name_type;
(*num_names)++;
}
@@ -1055,7 +1059,6 @@ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain,
/* Copy the entries over from the "_nocache" arrays
* to the result arrays, skipping the gaps the
* lookup_sids call left. */
- *num_names = 0;
for (i=0; i < num_nocache; i++) {
if (((names_nocache)[i] != NULL) &&
((name_types_nocache)[i] != SID_NAME_UNKNOWN))
diff --git a/source3/nsswitch/winbindd_group.c b/source3/nsswitch/winbindd_group.c
index 2d83dd3870..2b2ae7e579 100644
--- a/source3/nsswitch/winbindd_group.c
+++ b/source3/nsswitch/winbindd_group.c
@@ -576,6 +576,7 @@ static BOOL fill_grent_mem(struct winbindd_domain *domain,
/* One more round */
TALLOC_FREE(glist);
glist = new_glist;
+ n_glist = n_new_glist;
}
TALLOC_FREE( glist );