Lines Matching refs:gid
480 static void check_group(const group* grp, const char* group_name, gid_t gid, in check_group() argument
486 EXPECT_EQ(gid, grp->gr_gid); in check_group()
496 static void check_getgrgid(const char* group_name, gid_t gid, bool check_groupname) { in check_getgrgid() argument
498 group* grp = getgrgid(gid); in check_getgrgid()
501 check_group(grp, group_name, gid, check_groupname); in check_getgrgid()
504 static void check_getgrnam(const char* group_name, gid_t gid, bool check_groupname) { in check_getgrnam() argument
509 check_group(grp, group_name, gid, check_groupname); in check_getgrnam()
512 static void check_getgrgid_r(const char* group_name, gid_t gid, bool check_groupname) { in check_getgrgid_r() argument
518 int result = getgrgid_r(gid, &grp_storage, buf, sizeof(buf), &grp); in check_getgrgid_r()
522 check_group(grp, group_name, gid, check_groupname); in check_getgrgid_r()
525 static void check_getgrnam_r(const char* group_name, gid_t gid, bool check_groupname) { in check_getgrnam_r() argument
535 check_group(grp, group_name, gid, check_groupname); in check_getgrnam_r()
538 static void check_get_group(const char* group_name, gid_t gid, bool check_groupname = true) { in check_get_group() argument
540 check_getgrgid(group_name, gid, check_groupname); in check_get_group()
541 check_getgrnam(group_name, gid, check_groupname); in check_get_group()
542 check_getgrgid_r(group_name, gid, check_groupname); in check_get_group()
543 check_getgrnam_r(group_name, gid, check_groupname); in check_get_group()
546 static void expect_no_group_id(gid_t gid) { in expect_no_group_id() argument
547 SCOPED_TRACE("gid '" + std::to_string(gid) + "'"); in expect_no_group_id()
550 group = getgrgid(gid); in expect_no_group_id()
556 EXPECT_EQ(ENOENT, getgrgid_r(gid, &group_storage, buf, sizeof(buf), &group)); in expect_no_group_id()