/system/core/libcutils/ |
H A D | multiuser.c | 19 userid_t multiuser_get_user_id(uid_t uid) { argument 20 return uid / MULTIUSER_APP_PER_USER_RANGE; 23 appid_t multiuser_get_app_id(uid_t uid) { argument 24 return uid % MULTIUSER_APP_PER_USER_RANGE;
|
H A D | fs.c | 33 int fs_prepare_dir(const char* path, mode_t mode, uid_t uid, gid_t gid) { argument 50 if (((sb.st_mode & ALL_PERMS) == mode) && (sb.st_uid == uid) && (sb.st_gid == gid)) { 69 if (TEMP_FAILURE_RETRY(chown(path, uid, gid)) == -1) { 70 ALOGE("Failed to chown(%s, %d, %d): %s", path, uid, gid, strerror(errno));
|
H A D | qtaguid.c | 99 int qtaguid_tagSocket(int sockfd, int tag, uid_t uid) { argument 106 snprintf(lineBuf, sizeof(lineBuf), "t %d %llu %d", sockfd, kTag, uid); 108 ALOGV("Tagging socket %d with tag %llx{%u,0} for uid %d", sockfd, kTag, tag, uid); 112 ALOGI("Tagging socket %d with tag %llx(%d) for uid %d failed errno=%d", 113 sockfd, kTag, tag, uid, res); 134 int qtaguid_setCounterSet(int counterSetNum, uid_t uid) { argument 138 ALOGV("Setting counters to set %d for uid %d", counterSetNum, uid); 140 snprintf(lineBuf, sizeof(lineBuf), "s %d %d", counterSetNum, uid); 145 qtaguid_deleteTagData(int tag, uid_t uid) argument [all...] |
/system/core/libsysutils/src/ |
H A D | NetlinkListener.cpp | 48 uid_t uid = -1; local 51 socket, mBuffer, sizeof(mBuffer), &uid)); 53 if (uid > 0) 54 LOG_EVENT_INT(65537, uid);
|
/system/core/run-as/ |
H A D | package.h | 30 uid_t uid; member in struct:__anon472 39 extern int check_data_path(const char* dataDir, uid_t uid);
|
H A D | run-as.c | 38 * This program runs as set-uid root on Android production devices. 45 * until the uid/gid has been dropped to that of a normal user 105 int myuid, uid, gid; local 126 if (info.uid < AID_APP) { 138 if (check_data_path(info.dataDir, info.uid) < 0) { 159 uid = gid = info.uid; 160 if(setresgid(gid,gid,gid) || setresuid(uid,uid,uid)) { [all...] |
H A D | package.c | 29 * the run-as command has dropped the uid/gid. Hence be very 139 * - is owned by a given uid/gid 147 check_directory_ownership(const char* path, uid_t uid) argument 163 /* must be owned by specific uid/gid */ 164 if (st.st_uid != uid || st.st_gid != uid) 187 check_data_path(const char* dataPath, uid_t uid) argument 238 * directory is owned by the application uid 240 if (check_directory_ownership(dataPath, uid) < 0) 411 info->uid 440 int uid, debugFlag; local [all...] |
/system/extras/su/ |
H A D | su.c | 45 int uid, gid, myuid; local 50 fprintf(stderr,"su: uid %d not allowed to su\n", myuid); 55 uid = gid = 0; 60 uid = gid = atoi(argv[1]); 62 uid = pw->pw_uid; 67 if(setgid(gid) || setuid(uid)) {
|
/system/core/toolbox/ |
H A D | chown.c | 33 // Lookup uid (and gid if specified) 36 uid_t uid; local 41 uid = pw->pw_uid; 44 uid = (int) strtoul(user, &endptr, 0); 66 if (chown(argv[i], uid, gid) < 0) {
|
H A D | id.c | 12 static void print_uid(uid_t uid) argument 14 struct passwd *pw = getpwuid(uid); 17 printf("%d(%s)", uid, pw->pw_name); 19 printf("%d",uid); 44 printf("uid=");
|
H A D | ls.c | 79 static void user2str(unsigned uid, char *out) argument 81 struct passwd *pw = getpwuid(uid); 85 sprintf(out, "%d", uid);
|
/system/extras/ext4_utils/ |
H A D | contents.h | 28 u16 uid; member in struct:dentry 39 int inode_set_permissions(u32 inode_num, u16 mode, u16 uid, u16 gid, u32 mtime);
|
H A D | contents.c | 236 int inode_set_permissions(u32 inode_num, u16 mode, u16 uid, u16 gid, u32 mtime) argument 244 inode->i_uid = uid;
|
H A D | make_ext4fs.c | 85 .uid = 0, 93 dentries.uid, dentries.gid, dentries.mtime); 149 unsigned int uid = 0; local 152 fs_config_func(dentries[i].path, dir, &uid, &gid, &mode); 154 dentries[i].uid = uid; 215 dentries[i].uid, dentries[i].gid,
|
/system/core/init/ |
H A D | ueventd.c | 116 uid_t uid; local 166 ERROR("invalid uid '%s'\n", args[2]); 170 uid = ret; 180 add_dev_perms(name, attr, perm, uid, gid, prefix);
|
H A D | init.h | 55 uid_t uid; member in struct:socketinfo 93 uid_t uid; member in struct:service
|
H A D | property_service.c | 63 unsigned int uid; member in struct:__anon372 106 unsigned int uid; member in struct:__anon373 259 * Returns 1 if uid allowed, 0 otherwise. 261 static int check_control_perms(const char *name, unsigned int uid, unsigned int gid, char *sctx) { argument 264 if (uid == AID_SYSTEM || uid == AID_ROOT) 270 if ((uid && control_perms[i].uid == uid) || 281 * Returns 1 if uid allowe 283 check_perms(const char *name, unsigned int uid, unsigned int gid, char *sctx) argument [all...] |
H A D | util.c | 45 * android_name_to_id - returns the integer uid/gid associated with the given 63 * numeric or name representation, into the integer uid or gid. Returns -1U on 88 int create_socket(const char *name, int type, mode_t perm, uid_t uid, gid_t gid) argument 133 chown(addr.sun_path, uid, gid); 137 addr.sun_path, perm, uid, gid);
|
H A D | builtins.c | 91 static int _chown(const char *path, unsigned int uid, unsigned int gid) argument 101 ret = fchown(fd, uid, gid); 315 uid_t uid = decode_uid(args[3]); local 322 if (_chown(args[1], uid, gid) < 0) {
|
/system/netd/ |
H A D | FirewallController.cpp | 132 int FirewallController::setUidRule(int uid, FirewallRule rule) { argument 134 sprintf(uidStr, "%d", uid); 144 res |= execIptables(V4V6, op, LOCAL_INPUT, "-m", "owner", "--uid-owner", uidStr, 146 res |= execIptables(V4V6, op, LOCAL_OUTPUT, "-m", "owner", "--uid-owner", uidStr,
|
/system/core/cpio/ |
H A D | mkbootfs.c | 40 int uid, gid, mode; member in struct:fs_config_entry 45 /* Each line in the canned file should be a path plus three ints (uid, 59 // Use the list of file uid/gid/modes loaded from the file 69 s->st_uid = p->uid; 75 s->st_uid = empty_path_config->uid; 302 cc->uid = atoi(strtok(line, " \n")); 305 cc->uid = atoi(strtok(NULL, " \n"));
|
/system/extras/tests/iptables/qtaguid/ |
H A D | socketTag.cpp | 43 bool checkTag(uint64_t tag, uid_t uid); 124 * tag + uid. But it is not fool proof. 129 bool SockInfo::checkTag(uint64_t acct_tag, uid_t uid) { argument 154 asprintf(&match_template, "sock=%lx %s", addr, "tag=0x%llx (uid=%u)"); 158 asprintf(&match_template, "%s", " tag=0x%llx (uid=%u)"); 161 full_tag = acct_tag | uid; 163 asprintf(&buff, match_template, full_tag | uid, uid); 170 "sock=%lx tag=0x%llx (uid=%lu) pid=%u f_count=%lu", 172 if (!(res == 5 && k_tag == full_tag && k_uid == uid)) { [all...] |
/system/core/debuggerd/ |
H A D | debuggerd.c | 54 uid_t uid, gid; member in struct:__anon288 223 out_request->uid = cr.uid; 236 } else if (cr.uid == 0 237 || (cr.uid == AID_SYSTEM && msg.action == DEBUGGER_ACTION_DUMP_BACKTRACE)) { 241 &out_request->uid, &out_request->gid); 257 property_get("debug.db.uid", value, "-1"); 259 return debug_uid >= 0 && request->uid <= (uid_t)debug_uid; 270 XLOG("BOOM: pid=%d uid=%d gid=%d tid=%d\n", 271 request.pid, request.uid, reques [all...] |
/system/core/include/private/ |
H A D | android_filesystem_config.h | 89 #define AID_USER 100000 /* offset for uid ranges for each user */ 149 unsigned uid; member in struct:fs_path_config 203 /* the following two files are INTENTIONALLY set-gid and not set-uid. 207 /* the following five files are INTENTIONALLY set-uid, but they 215 /* the following file is INTENTIONALLY set-uid, and IS included 232 unsigned *uid, unsigned *gid, unsigned *mode) 253 *uid = pc->uid; 259 path, pc->prefix ? pc->prefix : "", *uid, *gid, *mode); 231 fs_config(const char *path, int dir, unsigned *uid, unsigned *gid, unsigned *mode) argument
|
/system/extras/tests/fstest/ |
H A D | perm_checker.c | 78 printf("# ERROR # Invalid uid '%s' reading line %d\n", str, line_num); 200 static void print_new_rule(const char *name, mode_t mode, uid_t uid, gid_t gid) argument 205 pw = getpwuid(uid); 206 printf("%s %4o %4o %s %d %s %d\n", name, mode, mode, pw->pw_name, uid, 211 static int pass_rule(const perm_rule_t *pr, mode_t mode, uid_t uid, gid_t gid) argument 216 (pr->min_uid <= uid) && (pr->max_uid >= uid)) 223 static int validate_file(const char *name, mode_t mode, uid_t uid, gid_t gid) argument 232 if (!pass_rule(pr, mode, uid, gid)) 245 print_new_rule(name, mode, uid, gi 284 validate_link(const char *name, mode_t mode, uid_t uid, gid_t gid) argument 312 validate_dir(const char *name, mode_t mode, uid_t uid, gid_t gid) argument [all...] |