The comment says we are adding the user and primary group sid to the array, but we add the user and the first group in the groupsids array. This is not always the primary group. How can we tell which is the primary group?