Skip to content

Commit 99417fa

Browse files
committed
Unset all auxiliary groups and simplify code
Since `rungid` is already set as primary group, there's no reason to also set it as auxiliary group. Closes #2589
1 parent a53c481 commit 99417fa

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

judge/runguard.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -923,9 +923,7 @@ void setrestrictions()
923923
/* Set group-id (must be root for this, so before setting user). */
924924
if ( use_group ) {
925925
if ( setgid(rungid) ) error(errno,"cannot set group ID to `%d'",rungid);
926-
gid_t aux_groups[1];
927-
aux_groups[0] = rungid;
928-
if ( setgroups(1, aux_groups) ) error(errno,"cannot clear auxiliary groups");
926+
if ( setgroups(0, NULL) ) error(errno,"cannot clear auxiliary groups");
929927

930928
verbose("using group ID `%d'",rungid);
931929
}

0 commit comments

Comments
 (0)