add CLOEXECs
Ensure that open file descriptors do not leak across an execve()
boundary by setting the O_CLOEXEC flag on them. Leaking file descriptors
to exec()d processes may prevent file descriptors from being properly
freed, introduce security bugs if the child process is untrusted, and
causes problems for systems like SELinux which perform strict checking
of passed file descriptors.
Bug: 112357170
Test: cts-tradefed run cts -m CtsRenderscriptTestCases
Change-Id: I91107f5712c2f5b4648b3dc45d6cbbc97d13762d
diff --git a/script_api/Specification.cpp b/script_api/Specification.cpp
index 5056b08..95ebc78 100644
--- a/script_api/Specification.cpp
+++ b/script_api/Specification.cpp
@@ -802,7 +802,7 @@
// Read the specification, adding the definitions to the global functions map.
bool SpecFile::readSpecFile(unsigned int maxApiLevel) {
- FILE* specFile = fopen(mSpecFileName.c_str(), "rt");
+ FILE* specFile = fopen(mSpecFileName.c_str(), "rte");
if (!specFile) {
cerr << "Error opening input file: " << mSpecFileName << "\n";
return false;