From f0c9edcfa5ccab161bbcdc0132aafaf09e62a186 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Tue, 22 Oct 2019 11:24:51 -0700 Subject: [PATCH] Do not request executable permission on Fuchsia file mappings unless it is required (#13290) Fixes https://github.com/flutter/flutter/issues/43273 --- shell/platform/fuchsia/flutter/component.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/shell/platform/fuchsia/flutter/component.cc b/shell/platform/fuchsia/flutter/component.cc index 66c5591b262..4ba6f06e717 100644 --- a/shell/platform/fuchsia/flutter/component.cc +++ b/shell/platform/fuchsia/flutter/component.cc @@ -99,9 +99,11 @@ static std::unique_ptr MakeFileMapping(const char* path, using Protection = fml::FileMapping::Protection; + std::initializer_list protection_execute = {Protection::kRead, + Protection::kExecute}; + std::initializer_list protection_read = {Protection::kRead}; auto mapping = std::make_unique( - fml::UniqueFD{fd}, std::initializer_list{ - Protection::kRead, Protection::kExecute}); + fml::UniqueFD{fd}, executable ? protection_execute : protection_read); if (!mapping->IsValid()) { return nullptr;