/system/extras/su/ |
D | su.cpp | 30 void pwtoid(const char* tok, uid_t* uid, gid_t* gid) { in pwtoid() argument 34 if (gid) *gid = pw->pw_gid; in pwtoid() 41 if (gid) *gid = tmpid; in pwtoid() 45 void extract_uidgids(const char* uidgids, uid_t* uid, gid_t* gid, gid_t* gids, int* gids_count) { in extract_uidgids() argument 52 *gid = *uid = 0; in extract_uidgids() 61 pwtoid(tok, uid, gid); in extract_uidgids() 69 pwtoid(tok, NULL, gid); in extract_uidgids() 103 gid_t gid = 0; in main() local 109 extract_uidgids(*argv, &uid, &gid, gids, &gids_count); in main() 118 if (setgid(gid)) error(1, errno, "setgid failed"); in main()
|
/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/sdcard/ |
D | sdcard.cpp | 173 static int fuse_setup(struct fuse* fuse, gid_t gid, mode_t mask) { in fuse_setup() argument 186 fuse->fd, fuse->global->uid, fuse->global->gid); in fuse_setup() 193 fuse->gid = gid; in fuse_setup() 199 static void drop_privs(uid_t uid, gid_t gid) { in drop_privs() argument 202 minijail_change_gid(j.get(), gid); in drop_privs() 215 gid_t gid, userid_t userid, bool multi_user, bool full_write) { in run() argument 238 global.gid = gid; in run() 304 drop_privs(uid, gid); in run() 307 fs_prepare_dir(global.obb_path, 0775, uid, gid); in run() 321 uid_t fsuid, gid_t fsgid, bool multi_user, userid_t userid, gid_t gid, in sdcardfs_setup() argument [all …]
|
/system/core/init/ |
D | ueventd_test.cpp | 73 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
|
D | descriptors.cpp | 38 gid_t gid, int perm, const std::string& context) in DescriptorInfo() argument 39 : name_(name), type_(type), uid_(uid), gid_(gid), perm_(perm), context_(context) { in DescriptorInfo() 75 gid_t gid, int perm, const std::string& context) in SocketInfo() argument 76 : DescriptorInfo(name, type, uid, gid, perm, context) { in SocketInfo() 89 return CreateSocket(name().c_str(), flags, passcred, perm(), uid(), gid(), context.c_str(), in Create() 98 gid_t gid, int perm, const std::string& context) in FileInfo() argument 100 : DescriptorInfo(name, type, uid, gid, perm, context) { in FileInfo()
|
D | init_parser_test.cpp | 62 bool gid, bool supplementary_gids) { in Test_make_exec_oneshot_service() argument 70 if (gid) { in Test_make_exec_oneshot_service() 100 if (gid) { in Test_make_exec_oneshot_service() 104 ASSERT_EQ(decoded_uid, svc->gid()); in Test_make_exec_oneshot_service() 106 ASSERT_EQ(0U, svc->gid()); in Test_make_exec_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 | 232 EXPECT_EQ(0U, permissions.gid()); in TEST() 245 EXPECT_EQ(1000U, permissions.gid()); in TEST() 259 EXPECT_EQ(1000U, permissions.gid()); in TEST() 275 EXPECT_EQ(1000U, permissions.gid()); in TEST() 285 EXPECT_EQ(1001U, permissions.gid()); in TEST() 299 EXPECT_EQ(1001U, permissions.gid()); in TEST() 311 EXPECT_EQ(1001U, permissions.gid()); in TEST()
|
D | devices.h | 37 Permissions(const std::string& name, mode_t perm, uid_t uid, gid_t gid); 43 gid_t gid() const { return gid_; } in gid() function 60 gid_t gid) in SysfsPermissions() argument 61 : Permissions(name, perm, uid, gid), attribute_(attribute) {} in SysfsPermissions()
|
D | devices.cpp | 104 Permissions::Permissions(const std::string& name, mode_t perm, uid_t uid, gid_t gid) in Permissions() argument 105 : name_(name), perm_(perm), uid_(uid), gid_(gid), prefix_(false), wildcard_(false) { in Permissions() 146 LOG(VERBOSE) << "fixup " << attribute_file << " " << uid() << " " << gid() << " " << std::oct in SetPermissions() 150 if (chown(attribute_file.c_str(), uid(), gid()) != 0) { in SetPermissions() 151 PLOG(ERROR) << "chown(" << attribute_file << ", " << uid() << ", " << gid() in SetPermissions() 215 return {it->perm(), it->uid(), it->gid()}; in GetDevicePermissions() 224 auto[mode, uid, gid] = GetDevicePermissions(path, links); in MakeDevice() 247 if (setegid(gid)) { in MakeDevice() 248 PLOG(ERROR) << "setegid(" << gid << ") for " << path << " device failed"; in MakeDevice()
|
D | ueventd_parser.cpp | 70 gid_t gid = grp->gr_gid; in ParsePermissionsLine() local 73 out_sysfs_permissions->emplace_back(name, sysfs_attribute, perm, uid, gid); in ParsePermissionsLine() 75 out_dev_permissions->emplace_back(name, perm, uid, gid); in ParsePermissionsLine()
|
D | service_test.cpp | 44 EXPECT_EQ(0U, service_in_old_memory->gid()); in TEST() 64 EXPECT_EQ(0U, service_in_old_memory2->gid()); in TEST()
|
/system/core/libcutils/ |
D | canned_fs_config.c | 32 unsigned gid; member 70 p->gid = atoi(strtok(NULL, " ")); in load_canned_fs_config() 96 unsigned* uid, unsigned* gid, unsigned* mode, uint64_t* capabilities) { in canned_fs_config() argument 107 *gid = p->gid; in canned_fs_config() 120 if (c_gid != *gid) printf("%s gid %d %d\n", path, *gid, c_gid); in canned_fs_config()
|
D | fs.c | 41 static int fs_prepare_path_impl(const char* path, mode_t mode, uid_t uid, gid_t gid, in fs_prepare_path_impl() argument 62 int owner_match = ((sb.st_uid == uid) && (sb.st_gid == gid)); in fs_prepare_path_impl() 71 path, uid, gid, sb.st_uid, sb.st_gid); in fs_prepare_path_impl() 101 if (TEMP_FAILURE_RETRY(chown(path, uid, gid)) == -1) { in fs_prepare_path_impl() 102 ALOGE("Failed to chown(%s, %d, %d): %s", path, uid, gid, strerror(errno)); in fs_prepare_path_impl() 109 int fs_prepare_dir(const char* path, mode_t mode, uid_t uid, gid_t gid) { in fs_prepare_dir() argument 110 return fs_prepare_path_impl(path, mode, uid, gid, /*allow_fixup*/ 1, /*prepare_as_dir*/ 1); in fs_prepare_dir() 113 int fs_prepare_dir_strict(const char* path, mode_t mode, uid_t uid, gid_t gid) { in fs_prepare_dir_strict() argument 114 return fs_prepare_path_impl(path, mode, uid, gid, /*allow_fixup*/ 0, /*prepare_as_dir*/ 1); in fs_prepare_dir_strict() 117 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 | 305 void fs_config(const char* path, int dir, const char* target_out_path, unsigned* uid, unsigned* gid, in fs_config() argument 350 *gid = get2LE((const uint8_t*)&(header.gid)); in fs_config() 366 *gid = pc->gid; in fs_config() 383 p->gid = get2LE((const uint8_t*)&(pc->gid)); in fs_config_generate()
|
/system/netd/server/ |
D | WakeupController.cpp | 51 gid_t gid = -1; in init() local 53 const auto attrHandler = [&prefix, &uid, &gid, ×tampNs](const nlattr attr, in init() 72 extract(payload, gid); in init() 73 gid = be32toh(gid); in init() 80 mReport(prefix, uid, gid, timestampNs); in init()
|
D | WakeupControllerTest.cpp | 40 void(const std::string& prefix, uid_t uid, gid_t gid, uint64_t timestampNs)); 70 [this](const std::string& prefix, uid_t uid, gid_t gid, uint64_t timestampNs) { in __anon394787540102() 71 mEventListener.onWakeupEvent(prefix, uid, gid, timestampNs); in __anon394787540102() 90 gid_t gid; in TEST_F() member 102 msg.gidAttr.nla_len = sizeof(msg.gidAttr) + sizeof(msg.gid); in TEST_F() 103 msg.gid = htobe32(kGid); in TEST_F() 134 gid_t gid; in TEST_F() member 151 msg.gidAttr.nla_len = sizeof(msg.gidAttr) + sizeof(msg.gid); in TEST_F() 152 msg.gid = htobe32(kGid); in TEST_F()
|
/system/extras/runconuid/ |
D | runconuid.cpp | 43 static gid_t gid = -1; variable 64 if (gid != (gid_t) -1 && setresgid(gid, gid, gid) < 0) { in do_child() 142 gid = lookup_gid(optarg); in parse_arguments()
|
/system/core/libcutils/include/private/ |
D | fs_config.h | 46 uint16_t gid; member 54 unsigned gid; member 73 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/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/extras/ext4_utils/ |
D | contents.h | 31 u16 gid; member 42 int inode_set_permissions(u32 inode_num, u16 mode, u16 uid, u16 gid, u32 mtime);
|
/system/core/adb/ |
D | file_sync_service.cpp | 75 gid_t gid = -1; in secure_mkdirs() local 88 fs_config(partial_path.c_str(), 1, nullptr, &uid, &gid, &mode, &capabilities); in secure_mkdirs() 95 if (chown(partial_path.c_str(), uid, gid) == -1) return false; in secure_mkdirs() 139 msg.stat_v2.gid = st.st_gid; in do_stat_v2() 201 static bool handle_send_file(int s, const char* path, uid_t uid, gid_t gid, uint64_t capabilities, in handle_send_file() argument 223 if (fchown(fd, uid, gid) == -1) { in handle_send_file() 397 gid_t gid = -1; in do_send() local 401 fs_config(path.c_str(), 0, nullptr, &uid, &gid, &broken_api_hack, &capabilities); in do_send() 404 return handle_send_file(s, path.c_str(), uid, gid, capabilities, mode, buffer, do_unlink); in do_send()
|
/system/core/liblog/ |
D | logger_write.c | 62 gid_t gid = getgid(); in check_log_uid_permissions() local 63 if ((gid != AID_SYSTEM) && (gid != AID_ROOT) && (gid != AID_LOG)) { in check_log_uid_permissions() 64 gid = getegid(); in check_log_uid_permissions() 65 if ((gid != AID_SYSTEM) && (gid != AID_ROOT) && (gid != AID_LOG)) { in check_log_uid_permissions()
|