Skip to content

Commit 935bea5

Browse files
committed
Close the metadata file in the child process
This prevents the submission from writing to the metadata file, which allows it to e.g. override runtime and whether the time limit was hit. Thanks Atsutoshi Kikuchi for reporting.
1 parent f79b0c7 commit 935bea5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

judge/runguard.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,6 +1263,13 @@ int main(int argc, char **argv)
12631263
}
12641264
verbose("pipes closed in child");
12651265

1266+
if ( outputmeta ) {
1267+
if ( fclose(metafile)!=0 ) {
1268+
error(errno,"closing file `%s'",metafilename);
1269+
}
1270+
verbose("metafile closed in child");
1271+
}
1272+
12661273
/* And execute child command. */
12671274
execvp(cmdname,cmdargs);
12681275
error(errno,"cannot start `%s'",cmdname);

0 commit comments

Comments
 (0)