mirror of
https://github.com/yarrick/iodine.git
synced 2025-10-17 16:51:54 +00:00
iodine/iodined: do not print usage if no superuser
There is no value in printing the usage in this case, as the usage doesn't give the user any hint on how to solve this issue. Furthermore, replace the Windows implementation with an empty inline function, which will result in no code. Signed-off-by: Ralf Ramsauer <ralf@ramses-pyramidenbau.de>
This commit is contained in:
12
src/common.c
12
src/common.c
@@ -101,18 +101,16 @@ int setgroups(int count, int *groups)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void
|
||||
check_superuser(void (*usage_fn)(void))
|
||||
{
|
||||
#ifndef WINDOWS32
|
||||
void
|
||||
check_superuser(void)
|
||||
{
|
||||
if (geteuid() != 0) {
|
||||
warnx("Run as root and you'll be happy.\n");
|
||||
usage_fn();
|
||||
/* NOTREACHED */
|
||||
exit(-1);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
char *
|
||||
format_addr(struct sockaddr_storage *sockaddr, int sockaddr_len)
|
||||
|
Reference in New Issue
Block a user