Home
last modified time | relevance | path

Searched refs:uid (Results 1 – 25 of 160) sorted by relevance

1234567

/system/security/keystore/
Dpermissions.cpp37 uid_t uid; member
46 uid_t uid; member
62 uid_t uid; member
82 snprintf(buf, len, "pid=%d uid=%d", ad->pid, ad->uid); in audit_callback()
108 static bool keystore_selinux_check_access(uid_t uid, perm_t perm, pid_t spid) { in keystore_selinux_check_access() argument
128 ad.uid = uid; in keystore_selinux_check_access()
141 uid_t get_keystore_euid(uid_t uid) { in get_keystore_euid() argument
144 if (user.uid == uid) { in get_keystore_euid()
149 return uid; in get_keystore_euid()
152 bool has_permission(uid_t uid, perm_t perm, pid_t spid) { in has_permission() argument
[all …]
Dkeystore.h29 uint32_t uid; member
57 android::String8 getKeyNameForUid(const android::String8& keyName, uid_t uid);
58 android::String8 getKeyNameForUidWithDir(const android::String8& keyName, uid_t uid);
78 bool hasGrant(const char* filename, const uid_t uid) const { in hasGrant() argument
79 return getGrant(filename, uid) != NULL; in hasGrant()
87 ResponseCode getKeyForName(Blob* keyBlob, const android::String8& keyName, const uid_t uid,
98 UserState* getUserStateByUid(uid_t uid);
108 const UserState* getUserStateByUid(uid_t uid) const;
127 const grant_t* getGrant(const char* filename, uid_t uid) const;
133 const BlobType type, uid_t uid);
[all …]
Dkeystore_cli.cpp104 int uid = -1; \
106 uid = atoi(argv[3]); \
107 fprintf(stderr, "Running as uid %d\n", uid); \
109 int32_t ret = service->cmd(String16(argv[2]), uid); \
129 int uid = -1; \
131 uid = atoi(argv[3]); \
132 fprintf(stderr, "Running as uid %d\n", uid); \
134 int32_t ret = service->cmd(String16(argv[2]), uid, &data, &dataSize); \
196 static int list(sp<IKeystoreService> service, const String16& name, int uid) { in list() argument
198 int32_t ret = service->list(name, uid, &matches); in list()
/system/core/gatekeeperd/
Dgatekeeperd.cpp77 void store_sid(uint32_t uid, uint64_t sid) { in store_sid() argument
79 sprintf(filename, "%u", uid); in store_sid()
103 void maybe_store_sid(uint32_t uid, uint64_t sid) { in maybe_store_sid() argument
105 sprintf(filename, "%u", uid); in maybe_store_sid()
107 store_sid(uid, sid); in maybe_store_sid()
111 uint64_t read_sid(uint32_t uid) { in read_sid() argument
114 sprintf(filename, "%u", uid); in read_sid()
122 void clear_sid(uint32_t uid) { in clear_sid() argument
124 sprintf(filename, "%u", uid); in clear_sid()
127 store_sid(uid, 0); in clear_sid()
[all …]
DIGateKeeperService.cpp34 uint32_t uid = data.readInt32(); in onTransact() local
53 int ret = enroll(uid, currentPasswordHandle, currentPasswordHandleSize, in onTransact()
77 uint32_t uid = data.readInt32(); in onTransact() local
89 int ret = verify(uid, (uint8_t *) currentPasswordHandle, in onTransact()
109 uint32_t uid = data.readInt32(); in onTransact() local
125 int ret = verifyChallenge(uid, challenge, (uint8_t *) currentPasswordHandle, in onTransact()
148 uint32_t uid = data.readInt32(); in onTransact() local
149 uint64_t sid = getSecureUserId(uid); in onTransact()
156 uint32_t uid = data.readInt32(); in onTransact() local
157 clearSecureUserId(uid); in onTransact()
/system/core/libprocessgroup/
Dprocessgroup.cpp87 static int convertUidToPath(char *path, size_t size, uid_t uid) in convertUidToPath() argument
92 uid); in convertUidToPath()
95 static int convertUidPidToPath(char *path, size_t size, uid_t uid, int pid) in convertUidPidToPath() argument
100 uid, in convertUidPidToPath()
105 static int initCtx(uid_t uid, int pid, struct ctx *ctx) in initCtx() argument
109 convertUidPidToPath(path, sizeof(path), uid, pid); in initCtx()
151 static pid_t getOneAppProcess(uid_t uid, int appProcessPid, struct ctx *ctx) in getOneAppProcess() argument
154 int ret = initCtx(uid, appProcessPid, ctx); in getOneAppProcess()
188 static int removeProcessGroup(uid_t uid, int pid) in removeProcessGroup() argument
193 convertUidPidToPath(path, sizeof(path), uid, pid); in removeProcessGroup()
[all …]
/system/netd/server/
DNetworkController.h57 uint32_t getNetworkForDns(unsigned* netId, uid_t uid) const;
58 unsigned getNetworkForUser(uid_t uid) const;
59 unsigned getNetworkForConnect(uid_t uid) const;
60 void getNetworkContext(unsigned netId, uid_t uid, struct android_net_context* netcontext) const;
71 Permission getPermissionForUser(uid_t uid) const;
73 int checkUserNetworkAccess(uid_t uid, unsigned netId) const;
86 const char* nexthop, bool legacy, uid_t uid) WARN_UNUSED_RESULT;
88 const char* nexthop, bool legacy, uid_t uid) WARN_UNUSED_RESULT;
90 bool canProtect(uid_t uid) const;
99 VirtualNetwork* getVirtualNetworkForUserLocked(uid_t uid) const;
[all …]
DNetworkController.cpp186 uint32_t NetworkController::getNetworkForDns(unsigned* netId, uid_t uid) const { in getNetworkForDns()
191 if (checkUserNetworkAccessLocked(uid, *netId) == 0) { in getNetworkForDns()
210 VirtualNetwork* virtualNetwork = getVirtualNetworkForUserLocked(uid); in getNetworkForDns()
225 unsigned NetworkController::getNetworkForUser(uid_t uid) const { in getNetworkForUser()
227 if (VirtualNetwork* virtualNetwork = getVirtualNetworkForUserLocked(uid)) { in getNetworkForUser()
247 unsigned NetworkController::getNetworkForConnect(uid_t uid) const { in getNetworkForConnect()
249 VirtualNetwork* virtualNetwork = getVirtualNetworkForUserLocked(uid); in getNetworkForConnect()
257 unsigned netId, uid_t uid, struct android_net_context* netcontext) const { in getNetworkContext() argument
263 .uid = uid, in getNetworkContext()
281 nc.app_netid = getNetworkForConnect(uid); in getNetworkContext()
[all …]
/system/extras/su/
Dsu.c30 void pwtoid(const char* tok, uid_t* uid, gid_t* gid) { in pwtoid() argument
33 if (uid) *uid = pw->pw_uid; in pwtoid()
40 if (uid) *uid = 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()
102 uid_t uid = 0; in main() local
109 extract_uidgids(*argv, &uid, &gid, gids, &gids_count); in main()
119 if (setuid(uid)) error(1, errno, "setuid failed"); in main()
124 struct passwd* pw = getpwuid(uid); in main()
/system/core/libcutils/
Duevent.c34 uid_t uid = -1; in uevent_kernel_multicast_recv() local
35 return uevent_kernel_multicast_uid_recv(socket, buffer, length, &uid); in uevent_kernel_multicast_recv()
47 ssize_t uevent_kernel_multicast_uid_recv(int socket, void *buffer, size_t length, uid_t *uid) in uevent_kernel_multicast_uid_recv() argument
49 return uevent_kernel_recv(socket, buffer, length, true, uid); in uevent_kernel_multicast_uid_recv()
52 ssize_t uevent_kernel_recv(int socket, void *buffer, size_t length, bool require_group, uid_t *uid) in uevent_kernel_recv() argument
67 *uid = -1; in uevent_kernel_recv()
80 *uid = cred->uid; in uevent_kernel_recv()
81 if (cred->uid != 0) { in uevent_kernel_recv()
Dqtaguid.c101 int qtaguid_tagSocket(int sockfd, int tag, uid_t uid) { in qtaguid_tagSocket() argument
108 snprintf(lineBuf, sizeof(lineBuf), "t %d %" PRIu64 " %d", sockfd, kTag, uid); in qtaguid_tagSocket()
110 ALOGV("Tagging socket %d with tag %" PRIx64 "{%u,0} for uid %d", sockfd, kTag, tag, uid); in qtaguid_tagSocket()
115 sockfd, kTag, tag, uid, res); in qtaguid_tagSocket()
136 int qtaguid_setCounterSet(int counterSetNum, uid_t uid) { in qtaguid_setCounterSet() argument
140 ALOGV("Setting counters to set %d for uid %d", counterSetNum, uid); in qtaguid_setCounterSet()
142 snprintf(lineBuf, sizeof(lineBuf), "s %d %d", counterSetNum, uid); in qtaguid_setCounterSet()
147 int qtaguid_deleteTagData(int tag, uid_t uid) { in qtaguid_deleteTagData() argument
152 ALOGV("Deleting tag data with tag %" PRIx64 "{%d,0} for uid %d", kTag, tag, uid); in qtaguid_deleteTagData()
156 snprintf(lineBuf, sizeof(lineBuf), "d %" PRIu64 " %d", kTag, uid); in qtaguid_deleteTagData()
[all …]
Dmultiuser.c19 userid_t multiuser_get_user_id(uid_t uid) { in multiuser_get_user_id() argument
20 return uid / MULTIUSER_APP_PER_USER_RANGE; in multiuser_get_user_id()
23 appid_t multiuser_get_app_id(uid_t uid) { in multiuser_get_app_id() argument
24 return uid % MULTIUSER_APP_PER_USER_RANGE; in multiuser_get_app_id()
Dcanned_fs_config.c29 unsigned uid; member
58 p->uid = atoi(strtok(NULL, " ")); in load_canned_fs_config()
86 unsigned* uid, unsigned* gid, unsigned* mode, uint64_t* capabilities) { in canned_fs_config() argument
96 *uid = p->uid; in canned_fs_config()
108 if (c_uid != *uid) printf("%s uid %d %d\n", path, *uid, c_uid); 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 …]
/system/core/logd/
DLogStatistics.h50 std::unique_ptr<const TEntry *[]> sort(uid_t uid, pid_t pid, in sort() argument
63 if ((uid != AID_ROOT) && (uid != entry.getUid())) { in sort()
129 uid_t uid,
135 std::unique_ptr<const TEntry *[]> sorted = sort(uid, pid,
226 const uid_t uid; member
231 uid(element->getUid()), in UidEntry()
235 inline const uid_t&getKey() const { return uid; } in getKey()
256 uid_t uid; member
262 uid(android::pidToUid(pid)), in PidEntry()
268 uid(element->getUid()), in PidEntry()
[all …]
DLogCommand.cpp60 bool clientHasLogCredentials(uid_t uid, gid_t gid, pid_t pid) { in clientHasLogCredentials() argument
61 if ((uid == AID_ROOT) || (uid == AID_SYSTEM) || (uid == AID_LOG)) { in clientHasLogCredentials()
120 if ((uid == u[0]) in clientHasLogCredentials()
121 && (uid == u[1]) in clientHasLogCredentials()
122 && (uid == u[2]) in clientHasLogCredentials()
123 && (uid == u[3])) { in clientHasLogCredentials()
DLogWhiteBlackList.cpp26 Prune::Prune(uid_t uid, pid_t pid) : mUid(uid), mPid(pid) { in Prune() argument
29 int Prune::cmp(uid_t uid, pid_t pid) const { in cmp() argument
30 if ((mUid == uid_all) || (mUid == uid)) { in cmp()
36 return uid - mUid; in cmp()
157 uid_t uid = Prune::uid_all; in init() local
159 uid = 0; in init()
161 uid = uid * 10 + *str++ - '0'; in init()
176 if ((uid == Prune::uid_all) && (pid == Prune::pid_all)) { in init()
188 int m = uid - p.mUid; in init()
201 list->insert(it, Prune(uid,pid)); in init()
[all …]
DLogStatistics.cpp156 const char *LogStatistics::uidToName(uid_t uid) const { in uidToName()
158 if (uid == AID_LOGD) { in uidToName()
166 if (info->aid == uid) { in uidToName()
173 uid_t userId = uid % AID_USER; in uidToName()
186 if (entry.getUid() == uid) { in uidToName()
217 uid_t uid = getUid(); in format() local
218 std::string name = android::base::StringPrintf("%u", uid); in format()
219 const char *nameTmp = stat.uidToName(uid); in format()
287 if (uid != AID_SYSTEM) { in format()
293 = stat.pidSystemTable[id].sort(uid, (pid_t)0, maximum_sorted_entries); in format()
[all …]
/system/core/run-as/
Drun-as.c113 uid_t myuid, uid, gid, userAppId = 0; in main() local
158 if ((UID_MAX - info.uid) / AID_USER < (uid_t)userId) { in main()
163 userAppId = (AID_USER * userId) + info.uid; in main()
183 uid = gid = userAppId; in main()
184 if(setresgid(gid,gid,gid) || setresuid(uid,uid,uid)) { in main()
194 if (selinux_android_setcontext(uid, 0, info.seinfo, pkgname) < 0) { in main()
209 struct passwd* pw = getpwuid(uid); in main()
/system/netd/server/binder/android/net/
DUidRange.cpp70 void UidRange::setStart(int32_t uid) { in setStart() argument
72 ALOG_ASSERT(uid <= mStop, "start UID must be less than or equal to stop UID"); in setStart()
74 mStart = uid; in setStart()
77 void UidRange::setStop(int32_t uid) { in setStop() argument
79 ALOG_ASSERT(uid <= mStop, "stop UID must be greater than or equal to start UID"); in setStop()
81 mStop = uid; in setStop()
/system/nativepower/daemon/
Dwake_lock_manager.cc54 uid_t uid) in Request() argument
57 uid(uid) {} in Request()
61 WakeLockManager::Request::Request() : uid(-1) {} in Request()
85 uid_t uid) { in AddRequest() argument
89 << " package=\"" << package << "\" uid=" << uid; in AddRequest()
101 requests_[client_binder] = Request(tag, package, uid); in AddRequest()
Dwake_lock_manager_stub.cc28 uid_t uid) { in ConstructRequestString() argument
29 return base::StringPrintf("%s,%s,%d", tag.c_str(), package.c_str(), uid); in ConstructRequestString()
43 return ConstructRequestString(req.tag, req.package, req.uid); in GetRequestString()
49 uid_t uid) { in AddRequest() argument
50 requests_[client_binder] = Request(tag, package, uid); in AddRequest()
/system/gatekeeper/
Dgatekeeper.cpp34 uint32_t uid = request.user_id; in Enroll() local
57 if (!GetFailureRecord(uid, user_id, &record, throttle_secure)) { in Enroll()
62 if (ThrottleRequest(uid, timestamp, &record, throttle_secure, response)) return; in Enroll()
64 if (!IncrementFailureRecord(uid, user_id, timestamp, &record, throttle_secure)) { in Enroll()
84 if (ClearFailureRecord(uid, user_id, true)) { in Enroll()
87 ClearFailureRecord(uid, user_id, false); in Enroll()
122 uint32_t uid = request.user_id; in Verify() local
131 if (!GetFailureRecord(uid, user_id, &record, throttle_secure)) { in Verify()
136 if (ThrottleRequest(uid, timestamp, &record, throttle_secure, response)) return; in Verify()
138 if (!IncrementFailureRecord(uid, user_id, timestamp, &record, throttle_secure)) { in Verify()
[all …]
/system/security/keystore/include/keystore/
DIKeystoreService.h156 virtual int32_t get(const String16& name, int32_t uid, uint8_t** item, size_t* itemLength) = 0;
158 virtual int32_t insert(const String16& name, const uint8_t* item, size_t itemLength, int uid,
161 virtual int32_t del(const String16& name, int uid) = 0;
163 virtual int32_t exist(const String16& name, int uid) = 0;
165 virtual int32_t list(const String16& prefix, int uid, Vector<String16>* matches) = 0;
177 virtual int32_t generate(const String16& name, int32_t uid, int32_t keyType, int32_t keySize,
180 virtual int32_t import(const String16& name, const uint8_t* data, size_t length, int uid,
195 virtual int64_t getmtime(const String16& name, int32_t uid) = 0;
202 virtual int32_t clear_uid(int64_t uid) = 0;
207 const uint8_t* entropy, size_t entropyLength, int uid, int flags,
[all …]
/system/core/libsysutils/src/
DNetlinkListener.cpp48 uid_t uid = -1; in onDataAvailable() local
56 mBuffer, sizeof(mBuffer), require_group, &uid)); in onDataAvailable()
58 if (uid > 0) in onDataAvailable()
59 LOG_EVENT_INT(65537, uid); in onDataAvailable()

1234567