Skip to content

Commit

Permalink
Correctly handle unshare call error status
Browse files Browse the repository at this point in the history
Thanks Keyu Tao for reporting.
  • Loading branch information
eldering committed Dec 3, 2023
1 parent d66221b commit 19909c4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion judge/runguard.c
Original file line number Diff line number Diff line change
Expand Up @@ -1217,7 +1217,9 @@ int main(int argc, char **argv)

cgroup_create();

unshare(CLONE_FILES|CLONE_FS|CLONE_NEWIPC|CLONE_NEWNET|CLONE_NEWNS|CLONE_NEWUTS|CLONE_SYSVSEM);
if ( unshare(CLONE_FILES|CLONE_FS|CLONE_NEWIPC|CLONE_NEWNET|CLONE_NEWNS|CLONE_NEWUTS|CLONE_SYSVSEM)!=0 ) {
error(errno, "calling unshare");
}

/* Check if any Linux Out-Of-Memory killer adjustments have to
* be made. The oom_adj or oom_score_adj is inherited by child
Expand Down

0 comments on commit 19909c4

Please sign in to comment.