From 11dd73a6460eea2e3af62593d5ba5973c73b9e93 Mon Sep 17 00:00:00 2001 From: Oleksandr Natalenko Date: Mon, 17 Oct 2022 10:57:29 +0200 Subject: [PATCH] rename check_superuser() to check_privileges() It's a preparatory commit to reflect upcoming changes in how capabilities are checked under Linux in presence of libcap-ng. No functional change. Signed-off-by: Oleksandr Natalenko --- src/common.c | 2 +- src/common.h | 4 ++-- src/iodine.c | 2 +- src/iodined.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/common.c b/src/common.c index 37ae48d..0d62752 100644 --- a/src/common.c +++ b/src/common.c @@ -103,7 +103,7 @@ int setgroups(int count, int *groups) #ifndef WINDOWS32 void -check_superuser(void) +check_privileges(void) { if (geteuid() != 0) { warnx("Run as root and you'll be happy."); diff --git a/src/common.h b/src/common.h index 0f990c1..38222da 100644 --- a/src/common.h +++ b/src/common.h @@ -105,11 +105,11 @@ enum connection { }; #ifdef WINDOWS32 -static inline void check_superuser(void) +static inline void check_privileges(void) { } #else -void check_superuser(void); +void check_privileges(void); #endif char *format_addr(struct sockaddr_storage *sockaddr, int sockaddr_len); int get_addr(char *, int, int, int, struct sockaddr_storage *); diff --git a/src/iodine.c b/src/iodine.c index fbb6481..3244dd9 100644 --- a/src/iodine.c +++ b/src/iodine.c @@ -279,7 +279,7 @@ int main(int argc, char **argv) } } - check_superuser(); + check_privileges(); argc -= optind; argv += optind; diff --git a/src/iodined.c b/src/iodined.c index f955516..772f9ef 100644 --- a/src/iodined.c +++ b/src/iodined.c @@ -2519,7 +2519,7 @@ main(int argc, char **argv) argc -= optind; argv += optind; - check_superuser(); + check_privileges(); if (argc != 2) usage();