/system/extras/su/ |
D | su.c | 35 void pwtoid(const char *tok, uid_t *uid, gid_t *gid) in pwtoid() argument 41 if (gid) *gid = pw->pw_gid; in pwtoid() 45 if (gid) *gid = tmpid; in pwtoid() 49 void extract_uidgids(const char *uidgids, uid_t *uid, gid_t *gid, gid_t *gids, in extract_uidgids() argument 58 *gid = *uid = 0; in extract_uidgids() 66 pwtoid(tok, uid, gid); in extract_uidgids() 74 pwtoid(tok, NULL, gid); in extract_uidgids() 106 gid_t gid, gids[10]; in main() local 116 uid = gid = 0; in main() 119 extract_uidgids(argv[1], &uid, &gid, gids, &gids_count); in main() [all …]
|
/system/extras/tests/fstest/ |
D | perm_checker.c | 200 static void print_new_rule(const char *name, mode_t mode, uid_t uid, gid_t gid) in print_new_rule() argument 204 gr = getgrgid(gid); in print_new_rule() 207 gr->gr_name, gid); in print_new_rule() 211 static int pass_rule(const perm_rule_t *pr, mode_t mode, uid_t uid, gid_t gid) in pass_rule() argument 215 (pr->min_gid <= gid) && (pr->max_gid >= gid) && in pass_rule() 223 static int validate_file(const char *name, mode_t mode, uid_t uid, gid_t gid) in validate_file() argument 232 if (!pass_rule(pr, mode, uid, gid)) in validate_file() 245 print_new_rule(name, mode, uid, gid); in validate_file() 255 if (!pass_rule(pr, mode, uid, gid)) in validate_file() 266 if (!pass_rule(pr, mode, uid, gid)) in validate_file() [all …]
|
/system/core/toolbox/ |
D | id.c | 20 static void print_gid(gid_t gid) in print_gid() argument 22 struct group *gr = getgrgid(gid); in print_gid() 24 printf("%d(%s)", gid, gr->gr_name); in print_gid() 26 printf("%d",gid); in print_gid()
|
D | chown.c | 37 gid_t gid = -1; // passing -1 to chown preserves current group in chown_main() local 54 gid = grp->gr_gid; in chown_main() 57 gid = (int) strtoul(group, &endptr, 0); in chown_main() 66 if (chown(argv[i], uid, gid) < 0) { in chown_main()
|
D | top.c | 58 gid_t gid; member 304 proc->gid = cur_proc.gid; in read_procs() 395 unsigned int uid, gid; in read_status() local 401 sscanf(line, "Gid: %u", &gid); in read_status() 404 proc->uid = uid; proc->gid = gid; in read_status() 466 group = getgrgid(proc->gid); in print_procs() 476 snprintf(group_buf, 20, "%d", proc->gid); in print_procs()
|
D | ls.c | 87 static void group2str(unsigned gid, char *out) in group2str() argument 89 struct group *gr = getgrgid(gid); in group2str() 93 sprintf(out, "%d", gid); in group2str()
|
/system/core/run-as/ |
D | run-as.c | 106 int myuid, uid, gid; in main() local 160 uid = gid = info.uid; in main() 161 if(setresgid(gid,gid,gid) || setresuid(uid,uid,uid)) { in main()
|
/system/core/init/ |
D | property_service.c | 63 unsigned int gid; member 106 unsigned int gid; member 249 static int check_control_perms(const char *name, unsigned int uid, unsigned int gid, char *sctx) { in check_control_perms() argument 259 (gid && control_perms[i].gid == gid)) { in check_control_perms() 271 static int check_perms(const char *name, unsigned int uid, unsigned int gid, char *sctx) in check_perms() argument 291 (gid && property_perms[i].gid == gid)) { in check_perms() 444 if (check_control_perms(msg.value, cr.uid, cr.gid, source_ctx)) { in handle_property_set_fd() 448 msg.name + 4, msg.value, cr.uid, cr.gid, cr.pid); in handle_property_set_fd() 451 if (check_perms(msg.name, cr.uid, cr.gid, source_ctx)) { in handle_property_set_fd()
|
D | ueventd.c | 117 gid_t gid; in set_device_permission() local 178 gid = ret; in set_device_permission() 180 add_dev_perms(name, attr, perm, uid, gid, prefix); in set_device_permission()
|
D | devices.c | 75 unsigned int gid; member 96 mode_t perm, unsigned int uid, unsigned int gid, in add_dev_perms() argument 114 node->dp.gid = gid; in add_dev_perms() 148 INFO("fixup %s %d %d 0%o\n", buf, dp->uid, dp->gid, dp->perm); in fixup_sys_perms() 149 chown(buf, dp->uid, dp->gid); in fixup_sys_perms() 154 static mode_t get_device_perm(const char *path, unsigned *uid, unsigned *gid) in get_device_perm() argument 176 *gid = dp->gid; in get_device_perm() 181 *gid = 0; in get_device_perm() 190 unsigned gid; in make_device() local 195 mode = get_device_perm(path, &uid, &gid) | (block ? S_IFBLK : S_IFCHR); in make_device() [all …]
|
D | init.h | 56 gid_t gid; member 94 gid_t gid; member
|
D | devices.h | 26 unsigned int gid, unsigned short prefix);
|
D | util.h | 29 uid_t uid, gid_t gid);
|
D | builtins.c | 89 static int _chown(const char *path, unsigned int uid, unsigned int gid) in _chown() argument 99 ret = fchown(fd, uid, gid); in _chown() 314 gid_t gid = -1; in do_mkdir() local 317 gid = decode_uid(args[4]); in do_mkdir() 320 if (_chown(args[1], uid, gid) < 0) { in do_mkdir()
|
D | util.c | 86 int create_socket(const char *name, int type, mode_t perm, uid_t uid, gid_t gid) in create_socket() argument 125 chown(addr.sun_path, uid, gid); in create_socket() 129 addr.sun_path, perm, uid, gid); in create_socket()
|
/system/core/libcutils/ |
D | fs.c | 34 int fs_prepare_dir(const char* path, mode_t mode, uid_t uid, gid_t gid) { in fs_prepare_dir() argument 51 if (((sb.st_mode & ALL_PERMS) == mode) && (sb.st_uid == uid) && (sb.st_gid == gid)) { in fs_prepare_dir() 70 if (TEMP_FAILURE_RETRY(chown(path, uid, gid)) == -1) { in fs_prepare_dir() 71 ALOGE("Failed to chown(%s, %d, %d): %s", path, uid, gid, strerror(errno)); in fs_prepare_dir()
|
/system/core/include/private/ |
D | android_filesystem_config.h | 163 unsigned gid; member 250 unsigned *uid, unsigned *gid, unsigned *mode, uint64_t *capabilities) in fs_config() argument 276 *gid = pc->gid; in fs_config() 282 path, pc->prefix ? pc->prefix : "", *uid, *gid, *mode); in fs_config()
|
/system/extras/ext4_utils/ |
D | contents.h | 29 u16 gid; member 40 int inode_set_permissions(u32 inode_num, u16 mode, u16 uid, u16 gid, u32 mtime);
|
D | make_ext4fs.c | 90 .gid = 0, in build_default_directory_structure() 97 dentries.uid, dentries.gid, dentries.mtime); in build_default_directory_structure() 172 unsigned int gid = 0; in build_directory_structure() local 174 fs_config_func(dentries[i].path, dir, &uid, &gid, &mode, &capabilities); in build_directory_structure() 177 dentries[i].gid = gid; in build_directory_structure() 233 dentries[0].gid = 0; in build_directory_structure() 271 dentries[i].uid, dentries[i].gid, in build_directory_structure()
|
/system/core/include/cutils/ |
D | fs.h | 44 extern int fs_prepare_dir(const char* path, mode_t mode, uid_t uid, gid_t gid);
|
/system/core/debuggerd/ |
D | debuggerd.c | 54 uid_t uid, gid; member 230 out_request->gid = cr.gid; in read_request() 248 &out_request->uid, &out_request->gid); in read_request() 279 request.pid, request.uid, request.gid, request.tid); in handle_request()
|
/system/core/cpio/ |
D | mkbootfs.c | 40 int uid, gid, mode; member 71 s->st_gid = p->gid; in fix_stat() 77 s->st_gid = empty_path_config->gid; in fix_stat() 308 cc->gid = atoi(strtok(NULL, " \n")); in read_canned_config()
|
/system/core/sdcard/ |
D | fuse.h | 99 __u32 gid; member 345 __u32 gid; member 542 __u32 gid; member
|
D | sdcard.c | 302 attr->gid = AID_SDCARD_RW; in attr_from_stat() 1250 static int run(const char* source_path, const char* dest_path, uid_t uid, gid_t gid, in run() argument 1268 fd, uid, gid); in run() 1276 res = setgid(gid); in run() 1307 gid_t gid = 0; in main() local 1328 } else if (!gid) { in main() 1331 gid = strtoul(arg, &endptr, 10); in main() 1350 if (!uid || !gid) { in main() 1365 res = run(source_path, dest_path, uid, gid, num_threads); in main()
|
/system/vold/ |
D | Volume.cpp | 417 int gid; in mountVol() local 422 gid = AID_SDCARD_RW; in mountVol() 425 gid = AID_MEDIA_RW; in mountVol() 428 AID_SYSTEM, gid, 0702, true)) { in mountVol()
|