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 <oleksandr@redhat.com>
This commit is contained in:
Oleksandr Natalenko 2022-10-17 10:57:29 +02:00
parent df49fd6f3d
commit 11dd73a646
4 changed files with 5 additions and 5 deletions

View File

@ -103,7 +103,7 @@ int setgroups(int count, int *groups)
#ifndef WINDOWS32 #ifndef WINDOWS32
void void
check_superuser(void) check_privileges(void)
{ {
if (geteuid() != 0) { if (geteuid() != 0) {
warnx("Run as root and you'll be happy."); warnx("Run as root and you'll be happy.");

View File

@ -105,11 +105,11 @@ enum connection {
}; };
#ifdef WINDOWS32 #ifdef WINDOWS32
static inline void check_superuser(void) static inline void check_privileges(void)
{ {
} }
#else #else
void check_superuser(void); void check_privileges(void);
#endif #endif
char *format_addr(struct sockaddr_storage *sockaddr, int sockaddr_len); char *format_addr(struct sockaddr_storage *sockaddr, int sockaddr_len);
int get_addr(char *, int, int, int, struct sockaddr_storage *); int get_addr(char *, int, int, int, struct sockaddr_storage *);

View File

@ -279,7 +279,7 @@ int main(int argc, char **argv)
} }
} }
check_superuser(); check_privileges();
argc -= optind; argc -= optind;
argv += optind; argv += optind;

View File

@ -2519,7 +2519,7 @@ main(int argc, char **argv)
argc -= optind; argc -= optind;
argv += optind; argv += optind;
check_superuser(); check_privileges();
if (argc != 2) if (argc != 2)
usage(); usage();