Searched defs:uid (Results 1 - 25 of 35) sorted by relevance

12

/system/core/libcutils/
H A Dmultiuser.c19 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 Dfs.c34 int fs_prepare_dir(const char* path, mode_t mode, uid_t uid, gid_t gid) { argument
51 if (((sb.st_mode & ALL_PERMS) == mode) && (sb.st_uid == uid) && (sb.st_gid == gid)) {
70 if (TEMP_FAILURE_RETRY(chown(path, uid, gid)) == -1) {
71 ALOGE("Failed to chown(%s, %d, %d): %s", path, uid, gid, strerror(errno));
H A Dqtaguid.c99 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 DNetlinkListener.cpp48 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 Dpackage.h30 uid_t uid; member in struct:__anon480
40 extern int check_data_path(const char* dataDir, uid_t uid);
H A Drun-as.c39 * This program runs as set-uid root on Android production devices.
46 * until the uid/gid has been dropped to that of a normal user
106 int myuid, uid, gid; local
127 if (info.uid < AID_APP) {
139 if (check_data_path(info.dataDir, info.uid) < 0) {
160 uid = gid = info.uid;
161 if(setresgid(gid,gid,gid) || setresuid(uid,uid,uid)) {
[all...]
H A Dpackage.c29 * 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 Dchown.c33 // 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 Did.c9 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 Dls.c77 static void user2str(unsigned uid, char *out) argument
79 struct passwd *pw = getpwuid(uid);
83 sprintf(out, "%d", uid);
/system/extras/ext4_utils/
H A Dcontents.h28 u16 uid; member in struct:dentry
40 int inode_set_permissions(u32 inode_num, u16 mode, u16 uid, u16 gid, u32 mtime);
H A Dcontents.c237 int inode_set_permissions(u32 inode_num, u16 mode, u16 uid, u16 gid, u32 mtime) argument
245 inode->i_uid = uid;
H A Dmake_ext4fs.c89 .uid = 0,
97 dentries.uid, dentries.gid, dentries.mtime);
171 unsigned int uid = 0; local
174 fs_config_func(dentries[i].path, dir, &uid, &gid, &mode, &capabilities);
176 dentries[i].uid = uid;
232 dentries[0].uid = 0;
271 dentries[i].uid, dentries[i].gid,
/system/extras/su/
H A Dsu.c35 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 Dkeystore_cli.cpp83 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 Dueventd.c116 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 Dinit.h55 uid_t uid; member in struct:socketinfo
93 uid_t uid; member in struct:service
H A Dproperty_service.c62 unsigned int uid; member in struct:__anon374
105 unsigned int uid; member in struct:__anon375
247 * Returns 1 if uid allowed, 0 otherwise.
249 static int check_control_perms(const char *name, unsigned int uid, unsigned int gid, char *sctx) { argument
252 if (uid == AID_SYSTEM || uid == AID_ROOT)
258 if ((uid && control_perms[i].uid == uid) ||
269 * Returns 1 if uid allowe
271 check_perms(const char *name, unsigned int uid, unsigned int gid, char *sctx) argument
[all...]
H A Dutil.c43 * android_name_to_id - returns the integer uid/gid associated with the given
61 * numeric or name representation, into the integer uid or gid. Returns -1U on
86 int create_socket(const char *name, int type, mode_t perm, uid_t uid, gid_t gid) argument
125 chown(addr.sun_path, uid, gid);
129 addr.sun_path, perm, uid, gid);
/system/netd/
H A DFirewallController.cpp132 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 Dmkbootfs.c40 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 DsocketTag.cpp43 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 Ddebuggerd.c54 uid_t uid, gid; member in struct:__anon289
206 LOG("timed out reading tid (from pid=%d uid=%d)\n", cr.pid, cr.uid);
214 LOG("read failure? %s (pid=%d uid=%d)\n",
215 strerror(errno), cr.pid, cr.uid);
221 LOG("invalid crash request of size %d (from pid=%d uid=%d)\n",
222 status, cr.pid, cr.uid);
229 out_request->uid = cr.uid;
243 } else if (cr.uid
[all...]
/system/core/include/private/
H A Dandroid_filesystem_config.h99 #define AID_USER 100000 /* offset for uid ranges for each user */
162 unsigned uid; member in struct:fs_path_config
219 /* the following file is INTENTIONALLY set-gid and not set-uid.
223 /* the following five files are INTENTIONALLY set-uid, but they
250 unsigned *uid, unsigned *gid, unsigned *mode, uint64_t *capabilities)
275 *uid = pc->uid;
282 path, pc->prefix ? pc->prefix : "", *uid, *gid, *mode);
249 fs_config(const char *path, int dir, unsigned *uid, unsigned *gid, unsigned *mode, uint64_t *capabilities) argument
/system/extras/tests/fstest/
H A Dperm_checker.c78 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...]

Completed in 3451 milliseconds

12