sync 3.0 into HEAD for the last time
[obnox/samba/samba-obnox.git] / source3 / rpc_server / srv_util.c
index 03e53118a89afe18bc4c912caf0f84dabb26e8c2..632d381503ee3317a58271d2a3be70179b5ab11a 100644 (file)
@@ -307,8 +307,17 @@ BOOL get_domain_user_groups(TALLOC_CTX *ctx, int *numgroups, DOM_GID **pgids, SA
         */
        gids = (DOM_GID *)talloc(ctx, sizeof(DOM_GID) *  num_entries);  
 
-       /* for each group, check if the user is a member of*/
+       /* for each group, check if the user is a member of.  Only include groups 
+          from this domain */
+       
        for(i=0; i<num_entries; i++) {
+       
+               if ( !sid_check_is_in_our_domain(&map[i].sid) ) {
+                       DEBUG(10,("get_domain_user_groups: skipping check of %s since it is not in our domain\n",
+                               map[i].nt_name));
+                       continue;
+               }
+                       
                if ((grp=getgrgid(map[i].gid)) == NULL) {
                        /* very weird !!! */
                        DEBUG(5,("get_domain_user_groups: gid %d doesn't exist anymore !\n", (int)map[i].gid));