Skip to content

Commit

Permalink
Fix a problem that prevented us from running as a non-privileged user.
Browse files Browse the repository at this point in the history
Thanks to @ingvarha who quickly pointed out the problem and came up with a fix.

Fixes: #322
  • Loading branch information
daghf committed Nov 27, 2019
1 parent a12107e commit dedfa54
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/hitch.c
Original file line number Diff line number Diff line change
Expand Up @@ -3993,8 +3993,10 @@ main(int argc, char **argv)
exit(1);
}

if (!verify_privileges())
if (geteuid() == 0 && CONFIG->UID < 0) {
ERR("{core} ERROR: Refusing to run workers as root.\n");
exit(1);
}

if (CONFIG->DAEMONIZE)
daemonize();
Expand Down

0 comments on commit dedfa54

Please sign in to comment.