diff -U7 -rN samba-3.5.9.orig/source3/auth/auth_util.c samba-3.5.9/source3/auth/auth_util.c --- samba-3.5.9.orig/source3/auth/auth_util.c 2011-06-14 14:17:28.000000000 +0300 +++ samba-3.5.9/source3/auth/auth_util.c 2011-06-20 23:31:38.000000000 +0300 @@ -2065,23 +2065,23 @@ /* Fill in the unix info we found on the way */ result->utok.uid = uid; result->utok.gid = gid; /* Create a 'combined' list of all SIDs we might want in the SD */ - result->num_sids = info->num_sids - 2; + result->num_sids = info->num_sids - 1; result->sids = talloc_array(result, DOM_SID, result->num_sids); if (result->sids == NULL) { TALLOC_FREE(result); return NT_STATUS_NO_MEMORY; } for (i=0; i < result->num_sids; i++) { - memcpy(&result->sids[i], &info->sids[i+2].sid, sizeof(result->sids[i])); + memcpy(&result->sids[i], &info->sids[i+1].sid, sizeof(result->sids[i])); } /* Ensure the primary group sid is at position 0. */ sort_sid_array_for_smbd(result, &group_sid); /* ensure we are never given NULL session keys */