summaryrefslogtreecommitdiff
path: root/source3/rpc_server/srv_samr.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/rpc_server/srv_samr.c')
-rw-r--r--source3/rpc_server/srv_samr.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c
index e92658ea4d..eb24f672a9 100644
--- a/source3/rpc_server/srv_samr.c
+++ b/source3/rpc_server/srv_samr.c
@@ -788,6 +788,8 @@ static BOOL samr_reply_enum_dom_aliases(SAMR_Q_ENUM_DOM_ALIASES *q_u,
while (num_entries < MAX_SAM_ENTRIES && ((grp = getgrent()) != NULL))
{
+ int i;
+ uint32 trid;
name = grp->gr_name;
/* Don't return winbind groups as they are not local! */
@@ -796,8 +798,14 @@ static BOOL samr_reply_enum_dom_aliases(SAMR_Q_ENUM_DOM_ALIASES *q_u,
continue;
}
+ trid = pdb_gid_to_group_rid(grp->gr_gid);
+ for( i = 0; i < num_entries; i++)
+ if ( pass[i].user_rid == trid ) break;
+ if ( i < num_entries )
+ continue; /* rid was there, dup! */
+
init_unistr2(&(pass[num_entries].uni_user_name), name, strlen(name)+1);
- pass[num_entries].user_rid = pdb_gid_to_group_rid(grp->gr_gid);
+ pass[num_entries].user_rid = trid;
num_entries++;
}