From a4aa38f8b927d6713c4cdd921a0a27cded041e94 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 6 Oct 2009 21:31:02 +0200 Subject: s3:winbind: Make query_user_list in winbindd_rpc a bit more readable --- source3/winbindd/winbindd_rpc.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'source3') diff --git a/source3/winbindd/winbindd_rpc.c b/source3/winbindd/winbindd_rpc.c index ac5c3d2d93..ce437f744c 100644 --- a/source3/winbindd/winbindd_rpc.c +++ b/source3/winbindd/winbindd_rpc.c @@ -99,14 +99,19 @@ static NTSTATUS query_user_list(struct winbindd_domain *domain, for (j = 0; j < num_dom_users; i++, j++) { uint32_t rid = disp_info.info1.entries[j].rid; + struct samr_DispEntryGeneral *src; + struct wbint_userinfo *dst; - (*info)[i].acct_name = talloc_strdup(mem_ctx, - disp_info.info1.entries[j].account_name.string); - (*info)[i].full_name = talloc_strdup(mem_ctx, - disp_info.info1.entries[j].full_name.string); - (*info)[i].homedir = NULL; - (*info)[i].shell = NULL; - sid_compose(&(*info)[i].user_sid, &domain->sid, rid); + src = &(disp_info.info1.entries[j]); + dst = &((*info)[i]); + + dst->acct_name = talloc_strdup( + mem_ctx, src->account_name.string); + dst->full_name = talloc_strdup( + mem_ctx, src->full_name.string); + dst->homedir = NULL; + dst->shell = NULL; + sid_compose(&dst->user_sid, &domain->sid, rid); /* For the moment we set the primary group for every user to be the Domain Users group. @@ -116,7 +121,7 @@ static NTSTATUS query_user_list(struct winbindd_domain *domain, force group' smb.conf parameter or something like that. */ - sid_compose(&(*info)[i].group_sid, &domain->sid, + sid_compose(&dst->group_sid, &domain->sid, DOMAIN_GROUP_RID_USERS); } -- cgit