Skip to content

Commit

Permalink
rename check_superuser() to check_privileges()
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
pfactum committed Oct 17, 2022
1 parent df49fd6 commit 11dd73a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand Down
4 changes: 2 additions & 2 deletions src/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 *);
Expand Down
2 changes: 1 addition & 1 deletion src/iodine.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ int main(int argc, char **argv)
}
}

check_superuser();
check_privileges();

argc -= optind;
argv += optind;
Expand Down
2 changes: 1 addition & 1 deletion src/iodined.c
Original file line number Diff line number Diff line change
Expand Up @@ -2519,7 +2519,7 @@ main(int argc, char **argv)
argc -= optind;
argv += optind;

check_superuser();
check_privileges();

if (argc != 2)
usage();
Expand Down

0 comments on commit 11dd73a

Please sign in to comment.