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/logging/logd/
DLogPermissions.cpp57 bool clientHasLogCredentials(uid_t uid, gid_t gid, pid_t pid) { in clientHasLogCredentials() argument
58 if (UserIsPrivileged(uid) || UserIsPrivileged(gid)) { in clientHasLogCredentials()
122 if ((gid == g[0]) && (gid == g[1]) && (gid == g[2]) && in clientHasLogCredentials()
123 (gid == g[3])) { in clientHasLogCredentials()
167 for (const auto& gid : supplemental_groups) { in clientHasLogCredentials() local
168 if (UserIsPrivileged(gid)) { 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.h113 .gid = (grp), \
138 #define DEFINE_BPF_MAP_GWO(the_map, TYPE, TypeOfKey, TypeOfValue, num_entries, gid) \ argument
139 DEFINE_BPF_MAP_UGM(the_map, TYPE, TypeOfKey, TypeOfValue, num_entries, AID_ROOT, gid, 0620)
141 #define DEFINE_BPF_MAP_GRO(the_map, TYPE, TypeOfKey, TypeOfValue, num_entries, gid) \ argument
142 DEFINE_BPF_MAP_UGM(the_map, TYPE, TypeOfKey, TypeOfValue, num_entries, AID_ROOT, gid, 0640)
144 #define DEFINE_BPF_MAP_GRW(the_map, TYPE, TypeOfKey, TypeOfValue, num_entries, gid) \ argument
145 DEFINE_BPF_MAP_UGM(the_map, TYPE, TypeOfKey, TypeOfValue, num_entries, AID_ROOT, gid, 0660)
160 .gid = (prog_gid), \
Dbpf_map_def.h138 unsigned int gid; // gid_t member
158 unsigned int gid; member
/system/core/libcutils/include_outside_system/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/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.cpp73 gid_t gid = 0; in TEST() local
75 std::generate_n(std::back_inserter(files_and_gids), 100, [&gid, &dir]() { in TEST()
76 gid++; in TEST()
77 return std::pair(dir.path + "/gid_"s + std::to_string(gid), gid); in TEST()
80 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()
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()
274 EXPECT_EQ(1000U, permissions.gid()); in TEST()
291 EXPECT_EQ(1000U, permissions.gid()); in TEST()
302 EXPECT_EQ(1001U, permissions.gid()); in TEST()
316 EXPECT_EQ(1001U, permissions.gid()); in TEST()
328 EXPECT_EQ(1001U, permissions.gid()); in TEST()
Dservice_parser.cpp154 auto gid = DecodeUid(args[1]); in ParseGroup() local
155 if (!gid.ok()) { in ParseGroup()
156 return Error() << "Unable to decode GID for '" << args[1] << "': " << gid.error(); in ParseGroup()
158 service_->proc_attr_.gid = *gid; in ParseGroup()
161 gid = DecodeUid(args[n]); in ParseGroup()
162 if (!gid.ok()) { in ParseGroup()
163 return Error() << "Unable to decode GID for '" << args[n] << "': " << gid.error(); in ParseGroup()
165 service_->proc_attr_.supp_gids.emplace_back(*gid); in ParseGroup()
456 auto gid = DecodeUid(args[5]); in ParseSocket() local
457 if (!gid.ok()) { in ParseSocket()
[all …]
Ddevices.h41 Permissions(const std::string& name, mode_t perm, uid_t uid, gid_t gid, bool no_fnm_pathname);
47 gid_t gid() const { return gid_; } in gid() function
67 gid_t gid, bool no_fnm_pathname) in SysfsPermissions() argument
68 : Permissions(name, perm, uid, gid, no_fnm_pathname), attribute_(attribute) {} in SysfsPermissions()
Dservice_utils.h53 gid_t gid = 0; member
85 gid_t gid; member
Ddevices.cpp127 Permissions::Permissions(const std::string& name, mode_t perm, uid_t uid, gid_t gid, in Permissions() argument
132 gid_(gid), in Permissions()
176 LOG(VERBOSE) << "fixup " << attribute_file << " " << uid() << " " << gid() << " " << std::oct in SetPermissions()
180 if (chown(attribute_file.c_str(), uid(), gid()) != 0) { in SetPermissions()
181 PLOG(ERROR) << "chown(" << attribute_file << ", " << uid() << ", " << gid() in SetPermissions()
246 return {it->perm(), it->uid(), it->gid()}; in GetDevicePermissions()
255 auto[mode, uid, gid] = GetDevicePermissions(path, links); in MakeDevice()
273 if (setegid(gid)) { in MakeDevice()
274 PLOG(ERROR) << "setegid(" << gid << ") for " << path << " device failed"; in MakeDevice()
/system/core/libprocessgroup/setup/
Dcgroup_map_write.cpp61 const std::string& gid, bool permissive_mode = false) { in ChangeDirModeAndOwner() argument
75 if (!gid.empty()) { in ChangeDirModeAndOwner()
76 group* gid_pwd = getgrnam(gid.c_str()); in ChangeDirModeAndOwner()
78 PLOG(ERROR) << "Unable to decode GID for '" << gid << "'"; in ChangeDirModeAndOwner()
116 const std::string& gid) { in Mkdir() argument
139 if (!ChangeDirModeAndOwner(path, mode, uid, gid, permissive_mode)) { in Mkdir()
271 descriptor.gid())) { in SetupCgroup()
276 if (!Mkdir(controller->path(), descriptor.mode(), descriptor.uid(), descriptor.gid())) { in SetupCgroup()
293 if (!Mkdir(controller->path(), descriptor.mode(), descriptor.uid(), descriptor.gid())) { in SetupCgroup()
369 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/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/logging/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()
/system/vold/
Dvold_prepare_subdirs.cpp57 static bool prepare_dir_for_user(struct selabel_handle* sehandle, mode_t mode, uid_t uid, gid_t gid, in prepare_dir_for_user() argument
79 << gid << " context " << (secontext ? secontext.get() : "null") in prepare_dir_for_user()
87 if (fs_prepare_dir(path.c_str(), mode, uid, gid) != 0) { in prepare_dir_for_user()
109 static bool prepare_dir(struct selabel_handle* sehandle, mode_t mode, uid_t uid, gid_t gid, in prepare_dir() argument
111 return prepare_dir_for_user(sehandle, mode, uid, gid, path, (uid_t)-1); in prepare_dir()

1234