kernel: fix set app profile may override other user's

This commit is contained in:
weishu
2023-06-04 13:59:14 +08:00
parent 5d449988fb
commit 8af5a9038b

View File

@@ -109,7 +109,9 @@ bool ksu_set_app_profile(struct app_profile *profile, bool persist)
list_for_each (pos, &allow_list) { list_for_each (pos, &allow_list) {
p = list_entry(pos, struct perm_data, list); p = list_entry(pos, struct perm_data, list);
if (!strcmp(profile->key, p->profile.key)) { // both uid and package must match, otherwise it will break multiple package with different user id
if (profile->current_uid == p->profile.current_uid &&
!strcmp(profile->key, p->profile.key)) {
// found it, just override it all! // found it, just override it all!
memcpy(&p->profile, profile, sizeof(*profile)); memcpy(&p->profile, profile, sizeof(*profile));
result = true; result = true;