aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2021-10-16 02:41:38 -0300
committerLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2021-10-16 17:08:29 -0300
commitf3001185bb91c4595ef1bde15e537c016edbd2a1 (patch)
treebb2b0985fa1fd58ecc3682214feb80f63eb5ceff /src
parentutil.c: remove tty comment from get_group_id (diff)
downloadfirejail-f3001185bb91c4595ef1bde15e537c016edbd2a1.tar.gz
firejail-f3001185bb91c4595ef1bde15e537c016edbd2a1.tar.zst
firejail-f3001185bb91c4595ef1bde15e537c016edbd2a1.zip
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 <grp.h> 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 <grp.h> header shall define the gid_t and size_t types as > described in <sys/types.h>. Note: The callers already store the result in gid_t variables. First caused by commit dc3564b18 ("fixes", 2016-03-09).
Diffstat (limited to 'src')
-rw-r--r--src/firejail/firejail.h2
-rw-r--r--src/firejail/util.c2
2 files changed, 2 insertions, 2 deletions
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);
532void wait_for_other(int fd); 532void wait_for_other(int fd);
533void notify_other(int fd); 533void notify_other(int fd);
534uid_t pid_get_uid(pid_t pid); 534uid_t pid_get_uid(pid_t pid);
535uid_t get_group_id(const char *group); 535gid_t get_group_id(const char *group);
536void flush_stdin(void); 536void flush_stdin(void);
537int create_empty_dir_as_user(const char *dir, mode_t mode); 537int create_empty_dir_as_user(const char *dir, mode_t mode);
538void create_empty_dir_as_root(const char *dir, mode_t mode); 538void 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) {
959} 959}
960 960
961 961
962uid_t get_group_id(const char *group) { 962gid_t get_group_id(const char *group) {
963 gid_t gid = 0; 963 gid_t gid = 0;
964 struct group *g = getgrnam(group); 964 struct group *g = getgrnam(group);
965 if (g) 965 if (g)