mirror of
https://github.com/yarrick/iodine.git
synced 2025-10-17 16:51:54 +00:00
Move superuser check to common.c
This commit is contained in:
11
src/common.c
11
src/common.c
@@ -82,6 +82,17 @@ int setgroups(int count, int *groups)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void
|
||||
check_superuser(void (*usage_fn)(void))
|
||||
{
|
||||
if (geteuid() != 0) {
|
||||
warnx("Run as root and you'll be happy.\n");
|
||||
usage_fn();
|
||||
/* NOTREACHED */
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
open_dns(int localport, in_addr_t listen_ip)
|
||||
{
|
||||
|
Reference in New Issue
Block a user