Home
last modified time | relevance | path

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

123

/system/extras/su/
Dsu.c30 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/
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()
133 if ((gid == g[0]) in clientHasLogCredentials()
134 && (gid == g[1]) in clientHasLogCredentials()
135 && (gid == g[2]) in clientHasLogCredentials()
136 && (gid == g[3])) { in clientHasLogCredentials()
/system/core/libcutils/
Dcanned_fs_config.c30 unsigned gid; member
59 p->gid = atoi(strtok(NULL, " ")); in load_canned_fs_config()
86 unsigned* uid, unsigned* gid, unsigned* mode, uint64_t* capabilities) { in canned_fs_config() argument
97 *gid = p->gid; in canned_fs_config()
109 if (c_gid != *gid) printf("%s gid %d %d\n", path, *gid, c_gid); in canned_fs_config()
Dfs.c40 static int fs_prepare_path_impl(const char* path, mode_t mode, uid_t uid, gid_t gid, in fs_prepare_path_impl() argument
61 int owner_match = ((sb.st_uid == uid) && (sb.st_gid == gid)); in fs_prepare_path_impl()
70 path, uid, gid, sb.st_uid, sb.st_gid); in fs_prepare_path_impl()
100 if (TEMP_FAILURE_RETRY(chown(path, uid, gid)) == -1) { in fs_prepare_path_impl()
101 ALOGE("Failed to chown(%s, %d, %d): %s", path, uid, gid, strerror(errno)); in fs_prepare_path_impl()
108 int fs_prepare_dir(const char* path, mode_t mode, uid_t uid, gid_t gid) { in fs_prepare_dir() argument
109 return fs_prepare_path_impl(path, mode, uid, gid, /*allow_fixup*/ 1, /*prepare_as_dir*/ 1); in fs_prepare_dir()
112 int fs_prepare_dir_strict(const char* path, mode_t mode, uid_t uid, gid_t gid) { in fs_prepare_dir_strict() argument
113 return fs_prepare_path_impl(path, mode, uid, gid, /*allow_fixup*/ 0, /*prepare_as_dir*/ 1); in fs_prepare_dir_strict()
116 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.c49 uint16_t gid; member
208 unsigned *uid, unsigned *gid, unsigned *mode, uint64_t *capabilities) in fs_config() argument
251 *gid = get2LE((const uint8_t *)&(header.gid)); in fs_config()
268 *gid = pc->gid; in fs_config()
286 p->gid = get2LE((const uint8_t *)&(pc->gid)); in fs_config_generate()
/system/core/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/init/
Dinit_parser_test.cpp60 bool gid, bool supplementary_gids) { in Test_make_exec_oneshot_service() argument
68 if (gid) { in Test_make_exec_oneshot_service()
95 if (gid) { in Test_make_exec_oneshot_service()
96 ASSERT_EQ(decode_uid("shell"), svc->gid()); in Test_make_exec_oneshot_service()
98 ASSERT_EQ(0U, svc->gid()); in Test_make_exec_oneshot_service()
Dueventd.cpp102 gid_t gid; in set_device_permission() local
168 gid = ret; in set_device_permission()
170 add_dev_perms(name, attr, perm, uid, gid, prefix, wildcard); in set_device_permission()
Ddevices.cpp78 unsigned int gid; member
100 mode_t perm, unsigned int uid, unsigned int gid, in add_dev_perms() argument
119 node->dp.gid = gid; in add_dev_perms()
157 INFO("fixup %s %d %d 0%o\n", buf, dp->uid, dp->gid, dp->perm); in fixup_sys_perms()
158 chown(buf, dp->uid, dp->gid); in fixup_sys_perms()
191 unsigned *uid, unsigned *gid) in get_device_perm() argument
222 *gid = dp->gid; in get_device_perm()
228 *gid = 0; in get_device_perm()
238 unsigned gid; in make_device() local
243 mode = get_device_perm(path, links, &uid, &gid) | (block ? S_IFBLK : S_IFCHR); in make_device()
[all …]
Dservice.cpp46 SocketInfo::SocketInfo() : uid(0), gid(0), perm(0) { in SocketInfo()
50 gid_t gid, int perm, const std::string& socketcon) in SocketInfo() argument
51 : name(name), type(type), uid(uid), gid(gid), perm(perm), socketcon(socketcon) { in SocketInfo()
71 unsigned flags, uid_t uid, gid_t gid, const std::vector<gid_t>& supp_gids, in Service() argument
74 time_crashed_(0), nr_crashed_(0), uid_(uid), gid_(gid), supp_gids_(supp_gids), in Service()
256 gid_t gid = args.size() > 5 ? decode_uid(args[5].c_str()) : 0; in HandleSocket() local
259 sockets_.emplace_back(args[1], args[2], uid, gid, perm, socketcon); in HandleSocket()
406 si.uid, si.gid, socketcon); in Start()
667 gid_t gid = 0; in MakeExecOneshotService() local
670 gid = decode_uid(args[3].c_str()); in MakeExecOneshotService()
[all …]
Dservice.h53 gid_t gid, int perm, const std::string& socketcon);
57 gid_t gid; member
75 unsigned flags, uid_t uid, gid_t gid, const std::vector<gid_t>& supp_gids,
95 gid_t gid() const { return gid_; } in gid() function
Ddevices.h26 unsigned int gid, unsigned short prefix,
/system/core/crash_reporter/
Duser_collector_test.cc98 gid_t gid; in TEST_F() local
101 &pid, &signal, &uid, &gid, &exec_name)); in TEST_F()
105 EXPECT_EQ(2000, gid); in TEST_F()
108 &pid, &signal, &uid, &gid, &exec_name)); in TEST_F()
112 EXPECT_EQ(-1, gid); in TEST_F()
116 &pid, &signal, &uid, &gid, &exec_name)); in TEST_F()
119 &pid, &signal, &uid, &gid, &exec_name)); in TEST_F()
123 &pid, &signal, &uid, &gid, &exec_name)); in TEST_F()
126 &pid, &signal, &uid, &gid, &exec_name)); in TEST_F()
129 &pid, &signal, &uid, &gid, &exec_name)); in TEST_F()
[all …]
/system/core/run-as/
Drun-as.c113 uid_t myuid, uid, gid, userAppId = 0; in main() local
183 uid = gid = userAppId; in main()
184 if(setresgid(gid,gid,gid) || setresuid(uid,uid,uid)) { in main()
/system/core/fingerprintd/
DFingerprintDaemonProxy.cpp64 msg->data.authenticated.finger.gid); in hal_notify_callback()
71 msg->data.authenticated.finger.gid); in hal_notify_callback()
76 msg->data.enroll.finger.gid, in hal_notify_callback()
80 msg->data.enroll.finger.gid, in hal_notify_callback()
86 msg->data.removed.finger.gid); in hal_notify_callback()
89 msg->data.removed.finger.gid); in hal_notify_callback()
94 msg->data.enumerated.finger.gid, in hal_notify_callback()
98 msg->data.enumerated.finger.gid, in hal_notify_callback()
/system/core/libpackagelistparser/
Dpackagelistparser.c61 gid_t gid; in parse_gids() local
72 gid = strtoul(token, &endptr, 10); in parse_gids()
81 if (gid > GID_MAX) { in parse_gids()
86 gid_list[cmp++] = gid; in parse_gids()
/system/extras/ext4_utils/
Dcontents.h29 u16 gid; member
40 int inode_set_permissions(u32 inode_num, u16 mode, u16 uid, u16 gid, u32 mtime);
/system/core/adb/
Dfile_sync_service.cpp52 gid_t gid = -1; in secure_mkdirs() local
65 fs_config(partial_path.c_str(), 1, nullptr, &uid, &gid, &mode, &cap); in secure_mkdirs()
72 if (chown(partial_path.c_str(), uid, gid) == -1) { in secure_mkdirs()
150 gid_t gid, mode_t mode, std::vector<char>& buffer, bool do_unlink) { in handle_send_file() argument
171 if (fchown(fd, uid, gid) == -1) { in handle_send_file()
340 gid_t gid = -1; in do_send() local
344 fs_config(path.c_str(), 0, nullptr, &uid, &gid, &broken_api_hack, &cap); in do_send()
347 return handle_send_file(s, path.c_str(), uid, gid, mode, buffer, do_unlink); in do_send()
/system/core/liblog/
Dlogger_write.c61 gid_t gid = getgid(); in check_log_uid_permissions() local
62 if ((gid != AID_SYSTEM) && in check_log_uid_permissions()
63 (gid != AID_ROOT) && in check_log_uid_permissions()
64 (gid != AID_LOG)) { in check_log_uid_permissions()
65 gid = getegid(); in check_log_uid_permissions()
66 if ((gid != AID_SYSTEM) && in check_log_uid_permissions()
67 (gid != AID_ROOT) && in check_log_uid_permissions()
68 (gid != AID_LOG)) { in check_log_uid_permissions()
Dpmsg_reader.c80 gid_t gid; in get_best_effective_uid() local
95 gid = getgid(); in get_best_effective_uid()
96 if (uid_has_log_permission(gid)) { in get_best_effective_uid()
97 return last_uid = gid; in get_best_effective_uid()
99 gid = getegid(); in get_best_effective_uid()
100 if (uid_has_log_permission(gid)) { in get_best_effective_uid()
101 return last_uid = gid; in get_best_effective_uid()
/system/core/sdcard/
Dsdcard.c198 gid_t gid; member
241 gid_t gid; member
418 if (fuse->gid == AID_SDCARD_RW) { in attr_from_stat()
424 attr->gid = AID_SDCARD_RW; in attr_from_stat()
426 attr->gid = multiuser_get_uid(node->userid, fuse->gid); in attr_from_stat()
438 if (fuse->gid == AID_SDCARD_RW) { in attr_from_stat()
1790 static int fuse_setup(struct fuse* fuse, gid_t gid, mode_t mask) { in fuse_setup() argument
1803 fuse->fd, fuse->global->uid, fuse->global->gid); in fuse_setup()
1810 fuse->gid = gid; in fuse_setup()
1817 gid_t gid, userid_t userid, bool multi_user, bool full_write) { in run() argument
[all …]
/system/core/include/private/
Dandroid_filesystem_config.h226 unsigned gid; member
246 unsigned *uid, unsigned *gid, unsigned *mode, uint64_t *capabilities);
Dcanned_fs_config.h24 unsigned* uid, unsigned* gid, unsigned* mode, uint64_t* capabilities);
/system/core/toolbox/
Dtop.c59 gid_t gid; member
305 proc->gid = cur_proc.gid; in read_procs()
414 unsigned int uid, gid; in read_status() local
420 sscanf(line, "Gid: %u", &gid); in read_status()
423 proc->uid = uid; proc->gid = gid; in read_status()
/system/core/cpio/
Dmkbootfs.c40 int uid, gid, mode; member
72 s->st_gid = p->gid; in fix_stat()
78 s->st_gid = empty_path_config->gid; in fix_stat()
313 cc->gid = atoi(strtok(NULL, " \n")); in read_canned_config()

123