diff --git a/main.c b/main.c index fc79ba5..b4c30a5 100644 --- a/main.c +++ b/main.c @@ -84,6 +84,9 @@ int main(int argc, const char** argv) return err; } + // Drop root privileges, we only needed those for the unshare call. + drop_root(); + pid_t pid = fork(); if (pid == -1) @@ -93,9 +96,6 @@ int main(int argc, const char** argv) return err; } - // Drop root privileges, we only needed those for the unshare call and fork above. - drop_root(); - if (pid != 0) { /// Head process