summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--python/runner/sandbox.c4
-rw-r--r--python/runner/terminator.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/python/runner/sandbox.c b/python/runner/sandbox.c
index 12e2720..4576060 100644
--- a/python/runner/sandbox.c
+++ b/python/runner/sandbox.c
@@ -22,10 +22,10 @@ int main(int argc, char* argv[])
return 1;
}
int ret = 0;
- if ((ret = setuid(pw->pw_uid)) != 0)
- fprintf(stderr, "setuid returned %d\n", ret);
if ((ret = setgid(pw->pw_gid)) != 0)
fprintf(stderr, "setgid returned %d\n", ret);
+ if ((ret = setuid(pw->pw_uid)) != 0)
+ fprintf(stderr, "setuid returned %d\n", ret);
// limit CPU time to 1 second
struct rlimit const cpu_limit = { .rlim_cur = 1, .rlim_max = 1 };
diff --git a/python/runner/terminator.c b/python/runner/terminator.c
index a994bde..0706957 100644
--- a/python/runner/terminator.c
+++ b/python/runner/terminator.c
@@ -20,10 +20,10 @@ int main(int argc, char* argv[])
return 1;
}
int ret = 0;
- if ((ret = setuid(pw->pw_uid)) != 0)
- fprintf(stderr, "setuid returned %d\n", ret);
if ((ret = setgid(pw->pw_gid)) != 0)
fprintf(stderr, "setgid returned %d\n", ret);
+ if ((ret = setuid(pw->pw_uid)) != 0)
+ fprintf(stderr, "setuid returned %d\n", ret);
pid_t pid = atol(argv[2]);
int signum = atoi(argv[3]);