/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 | 40 int fs_prepare_dir(const char* path, mode_t mode, uid_t uid, gid_t gid) { argument 57 if (((sb.st_mode & ALL_PERMS) == mode) && (sb.st_uid == uid) && (sb.st_gid == gid)) { 76 if (TEMP_FAILURE_RETRY(chown(path, uid, gid)) == -1) { 77 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:__anon238 40 extern int check_data_path(const char* dataDir, uid_t uid);
|
H A D | run-as.c | 46 * until the uid/gid has been dropped to that of a normal user 111 int myuid, uid, gid; local 132 if (info.uid < AID_APP) { 144 if (check_data_path(info.dataDir, info.uid) < 0) { 152 uid = gid = info.uid; 153 if(setresgid(gid,gid,gid) || setresuid(uid,uid,uid)) { 158 if (selinux_android_setcontext(uid, [all...] |
H A D | package.c | 29 * the run-as command has dropped the uid/gid. Hence be very 160 * - is owned by a given uid/gid 168 check_directory_ownership(const char* path, uid_t uid) argument 184 /* must be owned by specific uid/gid */ 185 if (st.st_uid != uid || st.st_gid != uid) 208 check_data_path(const char* dataPath, uid_t uid) argument 259 * directory is owned by the application uid 261 if (check_directory_ownership(dataPath, uid) < 0) 432 info->uid 463 int uid, debugFlag; local [all...] |
/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 | 9 static void print_uid(uid_t uid) argument 11 struct passwd *pw = getpwuid(uid); 14 printf("%d(%s)", uid, pw->pw_name); 16 printf("%d",uid); 39 printf("uid=");
|
H A D | ls.c | 78 static void user2str(unsigned uid, char *out) argument 80 struct passwd *pw = getpwuid(uid); 84 sprintf(out, "%d", uid);
|
/system/extras/ext4_utils/ |
H A D | contents.h | 28 u16 uid; member in struct:dentry 40 int inode_set_permissions(u32 inode_num, u16 mode, u16 uid, u16 gid, u32 mtime);
|
H A D | contents.c | 237 int inode_set_permissions(u32 inode_num, u16 mode, u16 uid, u16 gid, u32 mtime) argument 245 inode->i_uid = uid;
|
/system/netd/ |
H A D | UidMarkMap.cpp | 57 int UidMarkMap::getMark(int uid) { argument 62 if (entry->uid_start <= uid && entry->uid_end >= uid) {
|
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,
|
H A D | DnsProxyListener.cpp | 56 uid_t uid, 64 mUid(uid), 134 //fall back to the per uid interface if no per pid interface exists 216 uid_t uid = cli->getUid(); local 232 pid, uid); 237 new DnsProxyListener::GetAddrInfoHandler(cli, name, service, hints, iface, pid, uid, 238 mUidMarkMap->getMark(uid)); 269 uid_t uid = cli->getUid(); local 288 new DnsProxyListener::GetHostByNameHandler(cli, pid, uid, iface, name, af, 289 mUidMarkMap->getMark(uid)); 50 GetAddrInfoHandler(SocketClient *c, char* host, char* service, struct addrinfo* hints, char* iface, pid_t pid, uid_t uid, int mark) argument 295 GetHostByNameHandler(SocketClient* c, pid_t pid, uid_t uid, char* iface, char* name, int af, int mark) argument 397 uid_t uid = cli->getUid(); local 428 GetHostByAddrHandler(SocketClient* c, void* address, int addressLen, int addressFamily, char* iface, pid_t pid, uid_t uid, int mark) argument [all...] |
/system/extras/su/ |
H A D | su.c | 35 void pwtoid(const char *tok, uid_t *uid, gid_t *gid) argument 40 if (uid) *uid = pw->pw_uid; 44 if (uid) *uid = tmpid; 49 void extract_uidgids(const char *uidgids, uid_t *uid, gid_t *gid, gid_t *gids, argument 58 *gid = *uid = 0; 66 pwtoid(tok, uid, gid); 96 * su [uid[,gid[,group1]...] [cmd]] 100 * uid 105 uid_t uid, myuid; local [all...] |
/system/security/keystore/ |
H A D | keystore_cli.cpp | 83 fprintf(stderr, "Usage: %s " #cmd " <name> <uid>\n", argv[0]); \ 86 int uid = -1; \ 88 uid = atoi(argv[3]); \ 89 fprintf(stderr, "Running as uid %d\n", uid); \ 91 int32_t ret = service->cmd(String16(argv[2]), uid); \ 148 static int saw(sp<IKeystoreService> service, const String16& name, int uid) { argument 150 int32_t ret = service->saw(name, uid, &matches);
|
/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 94 uid_t uid; member in struct:service
|
H A D | property_service.c | 62 unsigned int uid; member in struct:__anon141 106 unsigned int uid; member in struct:__anon142 198 * Returns 1 if uid allowed, 0 otherwise. 200 static int check_control_perms(const char *name, unsigned int uid, unsigned int gid, char *sctx) { argument 203 if (uid == AID_SYSTEM || uid == AID_ROOT) 209 if ((uid && control_perms[i].uid == uid) || 220 * Returns 1 if uid allowe 222 check_perms(const char *name, unsigned int uid, unsigned int gid, char *sctx) argument [all...] |
H A D | util.c | 44 * android_name_to_id - returns the integer uid/gid associated with the given 62 * numeric or name representation, into the integer uid or gid. Returns -1U on 87 int create_socket(const char *name, int type, mode_t perm, uid_t uid, gid_t gid) argument 126 chown(addr.sun_path, uid, gid); 130 addr.sun_path, perm, uid, gid);
|
/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, 60 // Use the list of file uid/gid/modes loaded from the file 70 s->st_uid = p->uid; 76 s->st_uid = empty_path_config->uid; 303 cc->uid = atoi(strtok(line, " \n")); 306 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 | 55 uid_t uid, gid; member in struct:__anon21 207 LOG("timed out reading tid (from pid=%d uid=%d)\n", cr.pid, cr.uid); 215 LOG("read failure? %s (pid=%d uid=%d)\n", 216 strerror(errno), cr.pid, cr.uid); 222 LOG("invalid crash request of size %d (from pid=%d uid=%d)\n", 223 status, cr.pid, cr.uid); 230 out_request->uid = cr.uid; 244 } else if (cr.uid [all...] |
/system/core/include/private/ |
H A D | android_filesystem_config.h | 103 #define AID_USER 100000 /* offset for uid ranges for each user */ 177 unsigned uid; member in struct:fs_path_config 234 /* the following file is INTENTIONALLY set-gid and not set-uid. 238 /* the following five files are INTENTIONALLY set-uid, but they 265 unsigned *uid, unsigned *gid, unsigned *mode, uint64_t *capabilities) 290 *uid = pc->uid; 297 path, pc->prefix ? pc->prefix : "", *uid, *gid, *mode); 264 fs_config(const char *path, int dir, unsigned *uid, unsigned *gid, unsigned *mode, uint64_t *capabilities) argument
|