Excise snprintf -> slprintf.
[kai/samba.git] / source3 / rpc_server / srv_samr.c
index e92658ea4d23bcc13ad70a134f0d6988df489b03..eb24f672a991cd554bbe2f6d0259675961ab30e5 100644 (file)
@@ -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++;
                }