From f3001185bb91c4595ef1bde15e537c016edbd2a1 Mon Sep 17 00:00:00 2001 From: "Kelvin M. Klann" Date: Sat, 16 Oct 2021 02:41:38 -0300 Subject: util.c: fix return type of get_group_id gr_gid is of type gid_t (not uid_t). From grp.h(0p) of POSIX.1-2017: > DESCRIPTION > > The header shall declare the group structure, which shall > include the following members: > > char *gr_name The name of the group. > gid_t gr_gid Numerical group ID. > char **gr_mem Pointer to a null-terminated array of character > pointers to member names. > > The header shall define the gid_t and size_t types as > described in . Note: The callers already store the result in gid_t variables. First caused by commit dc3564b18 ("fixes", 2016-03-09). --- src/firejail/firejail.h | 2 +- src/firejail/util.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/firejail/firejail.h b/src/firejail/firejail.h index d29c2a976..c8d35c825 100644 --- a/src/firejail/firejail.h +++ b/src/firejail/firejail.h @@ -532,7 +532,7 @@ void update_map(char *mapping, char *map_file); void wait_for_other(int fd); void notify_other(int fd); uid_t pid_get_uid(pid_t pid); -uid_t get_group_id(const char *group); +gid_t get_group_id(const char *group); void flush_stdin(void); int create_empty_dir_as_user(const char *dir, mode_t mode); void create_empty_dir_as_root(const char *dir, mode_t mode); diff --git a/src/firejail/util.c b/src/firejail/util.c index 1f5665cbc..87ca4c1e7 100644 --- a/src/firejail/util.c +++ b/src/firejail/util.c @@ -959,7 +959,7 @@ uid_t pid_get_uid(pid_t pid) { } -uid_t get_group_id(const char *group) { +gid_t get_group_id(const char *group) { gid_t gid = 0; struct group *g = getgrnam(group); if (g) -- cgit v1.2.3-70-g09d2