Home
last modified time | relevance | path

Searched refs:gid (Results 1 – 25 of 79) sorted by relevance

1234

/system/extras/su/
Dsu.cpp29 void pwtoid(const char* tok, uid_t* uid, gid_t* gid) { in pwtoid() argument
33 if (gid) *gid = pw->pw_gid; in pwtoid()
40 if (gid) *gid = tmpid; in pwtoid()
44 void extract_uidgids(const char* uidgids, uid_t* uid, gid_t* gid, gid_t* gids, int* gids_count) { in extract_uidgids() argument
51 *gid = *uid = 0; in extract_uidgids()
60 pwtoid(tok, uid, gid); in extract_uidgids()
68 pwtoid(tok, NULL, gid); in extract_uidgids()
102 gid_t gid = 0; in main() local
108 extract_uidgids(*argv, &uid, &gid, gids, &gids_count); in main()
117 if (setgid(gid)) error(1, errno, "setgid failed"); in main()
/system/core/sdcard/
Dsdcard.cpp92 static void drop_privs(uid_t uid, gid_t gid) { in drop_privs() argument
95 minijail_change_gid(j.get(), gid); in drop_privs()
102 uid_t fsuid, gid_t fsgid, bool multi_user, userid_t userid, gid_t gid, in sdcardfs_setup() argument
120 fsuid, fsgid, new_opts.c_str(), mask, userid, gid); in sdcardfs_setup()
133 gid_t gid, mode_t mask) { in sdcardfs_setup_bind_remount() argument
134 std::string opts = android::base::StringPrintf("mask=%d,gid=%d", mask, gid); in sdcardfs_setup_bind_remount()
156 gid_t gid, mode_t mask, bool derive_gid, bool default_normal, in sdcardfs_setup_secondary() argument
159 return sdcardfs_setup(source_path, dest_path, fsuid, fsgid, multi_user, userid, gid, mask, in sdcardfs_setup_secondary()
162 return sdcardfs_setup_bind_remount(default_path, dest_path, gid, mask); in sdcardfs_setup_secondary()
167 gid_t gid, userid_t userid, bool multi_user, bool full_write, in run_sdcardfs() argument
[all …]
/system/core/logd/
DLogCommand.cpp60 bool clientHasLogCredentials(uid_t uid, gid_t gid, pid_t pid) { in clientHasLogCredentials() argument
65 if ((gid == AID_ROOT) || (gid == AID_SYSTEM) || (gid == AID_LOG)) { in clientHasLogCredentials()
130 if ((gid == g[0]) && (gid == g[1]) && (gid == g[2]) && in clientHasLogCredentials()
131 (gid == g[3])) { in clientHasLogCredentials()
/system/core/libcutils/
Dcanned_fs_config.cpp31 unsigned gid; member
69 p->gid = atoi(strtok(NULL, " ")); in load_canned_fs_config()
95 unsigned* uid, unsigned* gid, unsigned* mode, uint64_t* capabilities) { in canned_fs_config() argument
106 *gid = p->gid; in canned_fs_config()
119 if (c_gid != *gid) printf("%s gid %d %d\n", path, *gid, c_gid); in canned_fs_config()
Dfs.cpp42 static int fs_prepare_path_impl(const char* path, mode_t mode, uid_t uid, gid_t gid, in fs_prepare_path_impl() argument
68 owner_match = ((sb.st_uid == uid) && (sb.st_gid == gid)); in fs_prepare_path_impl()
77 path, uid, gid, sb.st_uid, sb.st_gid); in fs_prepare_path_impl()
107 if (TEMP_FAILURE_RETRY(chown(path, uid, gid)) == -1) { in fs_prepare_path_impl()
108 ALOGE("Failed to chown(%s, %d, %d): %s", path, uid, gid, strerror(errno)); in fs_prepare_path_impl()
115 int fs_prepare_dir(const char* path, mode_t mode, uid_t uid, gid_t gid) { in fs_prepare_dir() argument
116 return fs_prepare_path_impl(path, mode, uid, gid, /*allow_fixup*/ 1, /*prepare_as_dir*/ 1); in fs_prepare_dir()
119 int fs_prepare_dir_strict(const char* path, mode_t mode, uid_t uid, gid_t gid) { in fs_prepare_dir_strict() argument
120 return fs_prepare_path_impl(path, mode, uid, gid, /*allow_fixup*/ 0, /*prepare_as_dir*/ 1); in fs_prepare_dir_strict()
123 int fs_prepare_file_strict(const char* path, mode_t mode, uid_t uid, gid_t gid) { in fs_prepare_file_strict() argument
[all …]
Dfs_config.h26 uint16_t gid; member
34 unsigned gid; member
/system/bpf/progs/include/
Dbpf_helpers.h72 .gid = (grp), \
93 #define DEFINE_BPF_MAP_GWO(the_map, TYPE, TypeOfKey, TypeOfValue, num_entries, gid) \ argument
94 DEFINE_BPF_MAP_UGM(the_map, TYPE, TypeOfKey, TypeOfValue, num_entries, AID_ROOT, gid, 0620)
96 #define DEFINE_BPF_MAP_GRO(the_map, TYPE, TypeOfKey, TypeOfValue, num_entries, gid) \ argument
97 DEFINE_BPF_MAP_UGM(the_map, TYPE, TypeOfKey, TypeOfValue, num_entries, AID_ROOT, gid, 0640)
99 #define DEFINE_BPF_MAP_GRW(the_map, TYPE, TypeOfKey, TypeOfValue, num_entries, gid) \ argument
100 DEFINE_BPF_MAP_UGM(the_map, TYPE, TypeOfKey, TypeOfValue, num_entries, AID_ROOT, gid, 0660)
118 .gid = (prog_gid), \
Dbpf_map_def.h53 unsigned int gid; // gid_t member
59 unsigned int gid; member
/system/core/libcutils/include/cutils/
Dfs.h46 extern int fs_prepare_dir(const char* path, mode_t mode, uid_t uid, gid_t gid);
52 extern int fs_prepare_dir_strict(const char* path, mode_t mode, uid_t uid, gid_t gid);
58 extern int fs_prepare_file_strict(const char* path, mode_t mode, uid_t uid, gid_t gid);
/system/core/libcutils/include_vndk/cutils/
Dfs.h46 extern int fs_prepare_dir(const char* path, mode_t mode, uid_t uid, gid_t gid);
52 extern int fs_prepare_dir_strict(const char* path, mode_t mode, uid_t uid, gid_t gid);
58 extern int fs_prepare_file_strict(const char* path, mode_t mode, uid_t uid, gid_t gid);
/system/extras/runconuid/
Drunconuid.cpp47 static gid_t gid = -1; variable
75 if (gid != (gid_t) -1 && setresgid(gid, gid, gid) < 0) { in do_child()
153 gid = lookup_gid(optarg); in parse_arguments()
/system/core/init/
Dueventd_test.cpp77 gid_t gid = 0; in TEST() local
79 std::generate_n(std::back_inserter(files_and_gids), 100, [&gid, &dir]() { in TEST()
80 gid++; in TEST()
81 return std::pair(dir.path + "/gid_"s + std::to_string(gid), gid); in TEST()
84 WriteFromMultipleThreads(files_and_gids, [](gid_t gid) { EXPECT_EQ(0, setegid(gid)); }); in TEST() argument
Dservice_test.cpp48 EXPECT_EQ(0U, service_in_old_memory->gid()); in TEST()
67 EXPECT_EQ(0U, service_in_old_memory2->gid()); in TEST()
104 static void Test_make_temporary_oneshot_service(bool dash_dash, bool seclabel, bool uid, bool gid, in Test_make_temporary_oneshot_service() argument
112 if (gid) { in Test_make_temporary_oneshot_service()
142 if (gid) { in Test_make_temporary_oneshot_service()
145 ASSERT_EQ(*decoded_uid, svc->gid()); in Test_make_temporary_oneshot_service()
147 ASSERT_EQ(0U, svc->gid()); in Test_make_temporary_oneshot_service()
Dservice_parser.cpp121 auto gid = DecodeUid(args[1]); in ParseGroup() local
122 if (!gid.ok()) { in ParseGroup()
123 return Error() << "Unable to decode GID for '" << args[1] << "': " << gid.error(); in ParseGroup()
125 service_->proc_attr_.gid = *gid; in ParseGroup()
128 gid = DecodeUid(args[n]); in ParseGroup()
129 if (!gid.ok()) { in ParseGroup()
130 return Error() << "Unable to decode GID for '" << args[n] << "': " << gid.error(); in ParseGroup()
132 service_->proc_attr_.supp_gids.emplace_back(*gid); in ParseGroup()
423 auto gid = DecodeUid(args[5]); in ParseSocket() local
424 if (!gid.ok()) { in ParseSocket()
[all …]
Ddevices_test.cpp230 EXPECT_EQ(0U, permissions.gid()); in TEST()
243 EXPECT_EQ(1000U, permissions.gid()); in TEST()
257 EXPECT_EQ(1000U, permissions.gid()); in TEST()
273 EXPECT_EQ(1000U, permissions.gid()); in TEST()
283 EXPECT_EQ(1001U, permissions.gid()); in TEST()
297 EXPECT_EQ(1001U, permissions.gid()); in TEST()
309 EXPECT_EQ(1001U, permissions.gid()); in TEST()
Ddevices.h41 Permissions(const std::string& name, mode_t perm, uid_t uid, gid_t gid);
47 gid_t gid() const { return gid_; } in gid() function
66 gid_t gid) in SysfsPermissions() argument
67 : Permissions(name, perm, uid, gid), attribute_(attribute) {} in SysfsPermissions()
Dservice_utils.h49 gid_t gid = 0; member
77 gid_t gid; member
Ddevices.cpp126 Permissions::Permissions(const std::string& name, mode_t perm, uid_t uid, gid_t gid) in Permissions() argument
127 : name_(name), perm_(perm), uid_(uid), gid_(gid), prefix_(false), wildcard_(false) { in Permissions()
168 LOG(VERBOSE) << "fixup " << attribute_file << " " << uid() << " " << gid() << " " << std::oct in SetPermissions()
172 if (chown(attribute_file.c_str(), uid(), gid()) != 0) { in SetPermissions()
173 PLOG(ERROR) << "chown(" << attribute_file << ", " << uid() << ", " << gid() in SetPermissions()
237 return {it->perm(), it->uid(), it->gid()}; in GetDevicePermissions()
246 auto[mode, uid, gid] = GetDevicePermissions(path, links); in MakeDevice()
264 if (setegid(gid)) { in MakeDevice()
265 PLOG(ERROR) << "setegid(" << gid << ") for " << path << " device failed"; in MakeDevice()
/system/core/libprocessgroup/setup/
Dcgroup_map_write.cpp59 const std::string& gid, bool permissive_mode = false) { in ChangeDirModeAndOwner() argument
73 if (!gid.empty()) { in ChangeDirModeAndOwner()
74 group* gid_pwd = getgrnam(gid.c_str()); in ChangeDirModeAndOwner()
76 PLOG(ERROR) << "Unable to decode GID for '" << gid << "'"; in ChangeDirModeAndOwner()
114 const std::string& gid) { in Mkdir() argument
137 if (!ChangeDirModeAndOwner(path, mode, uid, gid, permissive_mode)) { in Mkdir()
251 descriptor.gid())) { in SetupCgroup()
258 if (!Mkdir(controller->path(), descriptor.mode(), descriptor.uid(), descriptor.gid())) { in SetupCgroup()
275 if (!Mkdir(controller->path(), descriptor.mode(), descriptor.uid(), descriptor.gid())) { in SetupCgroup()
344 const std::string& gid, uint32_t flags = 0) in CgroupDescriptor() argument
[all …]
Dcgroup_descriptor.h28 mode_t mode, const std::string& uid, const std::string& gid, uint32_t flags);
33 std::string gid() const { return gid_; } in gid() function
/system/core/adb/libs/libadbd_fs/
Dadbd_fs.cpp21 void adbd_fs_config(const char* path, int dir, const char* target_out_path, uid_t* uid, gid_t* gid, in adbd_fs_config() argument
28 *gid = gid_hack; in adbd_fs_config()
/system/core/libpackagelistparser/
Dpackagelistparser.cpp49 unsigned long gid = strtoul(gids, &end, 10); in parse_gids() local
50 if (gid > GID_MAX) { in parse_gids()
51 ALOGE("%s:%zu: gid %lu > GID_MAX", path, line_number, gid); in parse_gids()
56 info->gids.gids[i++] = gid; in parse_gids()
/system/netd/server/
DWakeupControllerTest.cpp106 gid_t gid; in TEST_F() member
118 msg.gidAttr.nla_len = sizeof(msg.gidAttr) + sizeof(msg.gid); in TEST_F()
119 msg.gid = htonl(kGid); in TEST_F()
156 gid_t gid; in TEST_F() member
179 msg.gidAttr.nla_len = sizeof(msg.gidAttr) + sizeof(msg.gid); in TEST_F()
180 msg.gid = htonl(kGid); in TEST_F()
227 gid_t gid; in TEST_F() member
244 msg.gidAttr.nla_len = sizeof(msg.gidAttr) + sizeof(msg.gid); in TEST_F()
245 msg.gid = htonl(kGid); in TEST_F()
DWakeupController.cpp126 .gid = -1, in init()
153 extract(payload, args.gid); in init()
154 args.gid = ntohl(args.gid); in init()
/system/core/liblog/
Dlogger_write.cpp67 gid_t gid = getgid(); in check_log_uid_permissions() local
68 if ((gid != AID_SYSTEM) && (gid != AID_ROOT) && (gid != AID_LOG)) { in check_log_uid_permissions()
69 gid = getegid(); in check_log_uid_permissions()
70 if ((gid != AID_SYSTEM) && (gid != AID_ROOT) && (gid != AID_LOG)) { in check_log_uid_permissions()

1234