- my $grouplist=join(" ", $ugid, $ugid, supplemental_groups($user));
- if (($)=$grouplist) ne $grouplist) {
- die "failed to set egid $grouplist: $!";
+ my $grouplist=join(" ", $ugid, sort {$a <=> $b} $ugid, supplemental_groups($user));
+ if (! samelists(($)=$grouplist), $grouplist)) {
+ die "failed to set egid $grouplist (got back $))";