/system/extras/su/ |
D | su.cpp | 29 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/ |
D | sdcard.cpp | 92 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/ |
D | LogCommand.cpp | 60 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/ |
D | canned_fs_config.cpp | 31 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()
|
D | fs.cpp | 42 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 …]
|
D | fs_config.cpp | 318 void fs_config(const char* path, int dir, const char* target_out_path, unsigned* uid, unsigned* gid, in fs_config() argument 363 *gid = get2LE((const uint8_t*)&(header.gid)); in fs_config() 379 *gid = pc->gid; in fs_config() 396 p->gid = get2LE((const uint8_t*)&(pc->gid)); in fs_config_generate()
|
/system/core/init/ |
D | descriptors.cpp | 37 gid_t gid, int perm, const std::string& context) in DescriptorInfo() argument 38 : name_(name), type_(type), uid_(uid), gid_(gid), perm_(perm), context_(context) { in DescriptorInfo() 74 gid_t gid, int perm, const std::string& context) in SocketInfo() argument 75 : DescriptorInfo(name, type, uid, gid, perm, context) { in SocketInfo() 88 return CreateSocket(name().c_str(), flags, passcred, perm(), uid(), gid(), context.c_str()); in Create() 96 gid_t gid, int perm, const std::string& context) in FileInfo() argument 98 : DescriptorInfo(name, type, uid, gid, perm, context) { in FileInfo()
|
D | ueventd_test.cpp | 77 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
|
D | service_test.cpp | 47 EXPECT_EQ(0U, service_in_old_memory->gid()); in TEST() 66 EXPECT_EQ(0U, service_in_old_memory2->gid()); in TEST() 103 static void Test_make_temporary_oneshot_service(bool dash_dash, bool seclabel, bool uid, bool gid, in Test_make_temporary_oneshot_service() argument 111 if (gid) { in Test_make_temporary_oneshot_service() 140 if (gid) { in Test_make_temporary_oneshot_service() 143 ASSERT_EQ(*decoded_uid, svc->gid()); in Test_make_temporary_oneshot_service() 145 ASSERT_EQ(0U, svc->gid()); in Test_make_temporary_oneshot_service()
|
D | descriptors.h | 31 gid_t gid, int perm, const std::string& context); 44 gid_t gid() const { return gid_; } in gid() function 65 gid_t gid, int perm, const std::string& context); 75 gid_t gid, int perm, const std::string& context);
|
D | devices_test.cpp | 230 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()
|
D | devices.h | 41 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()
|
D | devices.cpp | 139 Permissions::Permissions(const std::string& name, mode_t perm, uid_t uid, gid_t gid) in Permissions() argument 140 : name_(name), perm_(perm), uid_(uid), gid_(gid), prefix_(false), wildcard_(false) { in Permissions() 181 LOG(VERBOSE) << "fixup " << attribute_file << " " << uid() << " " << gid() << " " << std::oct in SetPermissions() 185 if (chown(attribute_file.c_str(), uid(), gid()) != 0) { in SetPermissions() 186 PLOG(ERROR) << "chown(" << attribute_file << ", " << uid() << ", " << gid() in SetPermissions() 250 return {it->perm(), it->uid(), it->gid()}; in GetDevicePermissions() 259 auto[mode, uid, gid] = GetDevicePermissions(path, links); in MakeDevice() 277 if (setegid(gid)) { in MakeDevice() 278 PLOG(ERROR) << "setegid(" << gid << ") for " << path << " device failed"; in MakeDevice()
|
D | service.cpp | 223 Service::Service(const std::string& name, unsigned flags, uid_t uid, gid_t gid, in Service() argument 233 gid_(gid), 483 auto gid = DecodeUid(args[1]); in ParseGroup() local 484 if (!gid) { in ParseGroup() 485 return Error() << "Unable to decode GID for '" << args[1] << "': " << gid.error(); in ParseGroup() 487 gid_ = *gid; in ParseGroup() 490 gid = DecodeUid(args[n]); in ParseGroup() 491 if (!gid) { in ParseGroup() 492 return Error() << "Unable to decode GID for '" << args[n] << "': " << gid.error(); in ParseGroup() 494 supp_gids_.emplace_back(*gid); in ParseGroup() [all …]
|
/system/core/libcutils/include/private/ |
D | fs_config.h | 47 uint16_t gid; member 55 unsigned gid; member 74 void fs_config(const char* path, int dir, const char* target_out_path, unsigned* uid, unsigned* gid,
|
/system/core/libcutils/include_vndk/cutils/ |
D | fs.h | 46 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/ |
D | fs.h | 46 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/ |
D | runconuid.cpp | 47 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/libprocessgroup/setup/ |
D | cgroup_map_write.cpp | 58 const std::string& gid) { in Mkdir() argument 92 if (!gid.empty()) { in Mkdir() 93 group* gid_pwd = getgrnam(gid.c_str()); in Mkdir() 95 PLOG(ERROR) << "Unable to decode GID for '" << gid << "'"; in Mkdir() 196 if (!Mkdir(controller->path(), descriptor.mode(), descriptor.uid(), descriptor.gid())) { in SetupCgroup() 270 const std::string& gid) in CgroupDescriptor() argument 271 : controller_(version, 0, name, path), mode_(mode), uid_(uid), gid_(gid) {} in CgroupDescriptor()
|
D | cgroup_descriptor.h | 28 mode_t mode, const std::string& uid, const std::string& gid); 33 std::string gid() const { return gid_; } in gid() function
|
/system/netd/server/ |
D | WakeupControllerTest.cpp | 106 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()
|
D | WakeupController.cpp | 126 .gid = -1, in init() 153 extract(payload, args.gid); in init() 154 args.gid = ntohl(args.gid); in init()
|
/system/core/libpackagelistparser/ |
D | packagelistparser.c | 60 gid_t gid; in parse_gids() local 71 gid = strtoul(token, &endptr, 10); in parse_gids() 80 if (gid > GID_MAX) { in parse_gids() 85 gid_list[cmp++] = gid; in parse_gids()
|
/system/core/adb/daemon/ |
D | file_sync_service.cpp | 100 gid_t gid = -1; in secure_mkdirs() local 114 fs_config(partial_path.c_str(), 1, nullptr, &uid, &gid, &mode, &capabilities); in secure_mkdirs() 121 if (chown(partial_path.c_str(), uid, gid) == -1) return false; in secure_mkdirs() 167 msg.stat_v2.gid = st.st_gid; in do_stat_v2() 229 static bool handle_send_file(int s, const char* path, uint32_t* timestamp, uid_t uid, gid_t gid, in handle_send_file() argument 257 if (fchown(fd.get(), uid, gid) == -1) { in handle_send_file() 433 gid_t gid = -1; in do_send() local 437 fs_config(path.c_str(), 0, nullptr, &uid, &gid, &broken_api_hack, &capabilities); in do_send() 441 result = handle_send_file(s, path.c_str(), ×tamp, uid, gid, capabilities, mode, buffer, in do_send()
|
/system/core/liblog/ |
D | logger_write.cpp | 58 gid_t gid = getgid(); in check_log_uid_permissions() local 59 if ((gid != AID_SYSTEM) && (gid != AID_ROOT) && (gid != AID_LOG)) { in check_log_uid_permissions() 60 gid = getegid(); in check_log_uid_permissions() 61 if ((gid != AID_SYSTEM) && (gid != AID_ROOT) && (gid != AID_LOG)) { in check_log_uid_permissions()
|