mirror of
https://gitee.com/openharmony/distributeddatamgr_pasteboard
synced 2024-11-27 01:52:01 +00:00
Description:add permission check
Feature or Bugfix:Bugfix Bunary Source:No Signed-off-by: yyh <yangyinghua1@huawei.com>
This commit is contained in:
parent
ac049f302c
commit
2849a0a1e7
@ -1132,6 +1132,7 @@ void PasteboardService::CheckAppUriPermission(PasteData &data)
|
||||
std::vector<std::string> uris;
|
||||
std::vector<size_t> indexs;
|
||||
std::vector<bool> checkResults;
|
||||
pid_t callingUid = IPCSkeleton::GetCallingUid();
|
||||
for (size_t i = 0; i < data.GetRecordCount(); i++) {
|
||||
auto item = data.GetRecordAt(i);
|
||||
if (item == nullptr || item->GetOrginUri() == nullptr) {
|
||||
@ -1163,7 +1164,8 @@ void PasteboardService::CheckAppUriPermission(PasteData &data)
|
||||
if (item == nullptr || item->GetOrginUri() == nullptr) {
|
||||
continue;
|
||||
}
|
||||
item->SetGrantUriPermission(checkResults[i]);
|
||||
bool result = (uid_ != -1 && callingUid == uid_) ? true : checkResults[i];
|
||||
item->SetGrantUriPermission(result);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user