mounts: Validate interpreter as early as possible

PiperOrigin-RevId: 240972700
Change-Id: I9049af7d053152cebd264fbfc352d2971a06d363
This commit is contained in:
Wiktor Garbacz 2019-03-29 07:07:03 -07:00 committed by Copybara-Service
parent 137f772f2b
commit 29fac2d393

View File

@ -274,6 +274,7 @@ std::string GetPlatform(absl::string_view interpreter) {
} }
SAPI_RAW_VLOG(1, "The file %s is using interpreter %s", path, interpreter); SAPI_RAW_VLOG(1, "The file %s is using interpreter %s", path, interpreter);
SAPI_RETURN_IF_ERROR(ValidateInterpreter(interpreter));
std::vector<std::string> search_paths; std::vector<std::string> search_paths;
// 1. LD_LIBRARY_PRELOAD // 1. LD_LIBRARY_PRELOAD
@ -290,7 +291,6 @@ std::string GetPlatform(absl::string_view interpreter) {
"/usr/lib", "/usr/lib",
"/usr/lib64", "/usr/lib64",
}); });
SAPI_RETURN_IF_ERROR(ValidateInterpreter(interpreter));
std::vector<std::string> hw_cap_paths = { std::vector<std::string> hw_cap_paths = {
GetPlatform(interpreter), GetPlatform(interpreter),
"tls", "tls",