Home
last modified time | relevance | path

Searched refs:gids (Results 1 – 6 of 6) sorted by relevance

/system/core/libpackagelistparser/
Dpackagelistparser.cpp31 static bool parse_gids(const char* path, size_t line_number, const char* gids, pkg_info* info) { in parse_gids() argument
33 if (!gids || !strcmp(gids, "none")) return true; in parse_gids()
36 info->gids.cnt = 1; in parse_gids()
37 for (const char* p = gids; *p; ++p) { in parse_gids()
38 if (*p == ',') ++info->gids.cnt; in parse_gids()
42 info->gids.gids = new gid_t[info->gids.cnt]; in parse_gids()
43 if (!info->gids.gids) return false; in parse_gids()
49 unsigned long gid = strtoul(gids, &end, 10); in parse_gids()
55 if (i >= info->gids.cnt) return false; in parse_gids()
56 info->gids.gids[i++] = gid; in parse_gids()
[all …]
Dpackagelistparser_test.cpp55 ASSERT_EQ(0U, packages[0]->gids.cnt); in TEST()
64 ASSERT_EQ(1U, packages[1]->gids.cnt); in TEST()
65 ASSERT_EQ(1023U, packages[1]->gids.gids[0]); in TEST()
74 ASSERT_EQ(6U, packages[2]->gids.cnt); in TEST()
75 ASSERT_EQ(2001U, packages[2]->gids.gids[0]); in TEST()
76 ASSERT_EQ(1024U, packages[2]->gids.gids[5]); in TEST()
85 ASSERT_EQ(0U, packages[3]->gids.cnt); in TEST()
/system/extras/su/
Dsu.cpp44 void extract_uidgids(const char* uidgids, uid_t* uid, gid_t* gid, gid_t* gids, int* gids_count) { in extract_uidgids() argument
71 pwtoid(tok, NULL, gids); in extract_uidgids()
73 gids++; in extract_uidgids()
106 gid_t gids[10]; in main() local
107 int gids_count = sizeof(gids)/sizeof(gids[0]); in main()
108 extract_uidgids(*argv, &uid, &gid, gids, &gids_count); in main()
110 if (setgroups(gids_count, gids)) { in main()
/system/core/run-as/
Drun-as.cpp146 std::vector<gid_t> gids; in get_supplementary_gids() local
147 int size = getgroups(0, &gids[0]); in get_supplementary_gids()
151 gids.resize(size); in get_supplementary_gids()
152 size = getgroups(size, &gids[0]); in get_supplementary_gids()
153 if (size != static_cast<int>(gids.size())) { in get_supplementary_gids()
160 gids.push_back(shared_app_gid); in get_supplementary_gids()
161 return gids; in get_supplementary_gids()
/system/extras/simpleperf/simpleperf_app_runner/
Dsimpleperf_app_runner.cpp92 std::vector<gid_t> gids; in GetSupplementaryGids() local
93 int size = getgroups(0, &gids[0]); in GetSupplementaryGids()
97 gids.resize(size); in GetSupplementaryGids()
98 size = getgroups(size, &gids[0]); in GetSupplementaryGids()
99 if (size != static_cast<int>(gids.size())) { in GetSupplementaryGids()
106 gids.push_back(shared_app_gid); in GetSupplementaryGids()
107 return gids; in GetSupplementaryGids()
/system/core/libpackagelistparser/include/packagelistparser/
Dpackagelistparser.h29 gid_t* gids; member
49 gid_list gids; member