Do not request executable permission on Fuchsia file mappings unless it is required (#13290)

Fixes https://github.com/flutter/flutter/issues/43273
This commit is contained in:
Jason Simmons 2019-10-22 11:24:51 -07:00 committed by GitHub
parent a554235978
commit f0c9edcfa5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -99,9 +99,11 @@ static std::unique_ptr<fml::FileMapping> MakeFileMapping(const char* path,
using Protection = fml::FileMapping::Protection;
std::initializer_list<Protection> protection_execute = {Protection::kRead,
Protection::kExecute};
std::initializer_list<Protection> protection_read = {Protection::kRead};
auto mapping = std::make_unique<fml::FileMapping>(
fml::UniqueFD{fd}, std::initializer_list<Protection>{
Protection::kRead, Protection::kExecute});
fml::UniqueFD{fd}, executable ? protection_execute : protection_read);
if (!mapping->IsValid()) {
return nullptr;