commit | e69642936ef28e09970e8a3abb36f31e3d7d17bf | [log] [tgz] |
---|---|---|
author | Calin Juravle <calin@google.com> | Thu May 23 13:14:35 2019 -0700 |
committer | Calin Juravle <calin@google.com> | Sat Jun 01 00:47:05 2019 +0000 |
tree | 590a887a95cedb03fc118750cde87c2897bdaedc | |
parent | b2c18293a45540864328b8160b9fea08d21775bf [diff] |
Use conservative permissions when creating files in ART Use 644 permissions by default so that only the owner has write-rights. Bug: 130821293 Test: host run-test & gtest Merged-In: Ic4dae399a5bfe862aff3d8614c45b38044d805db Merged-In: I09eab9749d1ce5872ecaf7d5a80fc45c9c708853 Change-Id: I09eab9749d1ce5872ecaf7d5a80fc45c9c708853
diff --git a/runtime/os_linux.cc b/runtime/os_linux.cc index f45e9f6..b628846 100644 --- a/runtime/os_linux.cc +++ b/runtime/os_linux.cc
@@ -54,7 +54,7 @@ File* OS::OpenFileWithFlags(const char* name, int flags) { CHECK(name != nullptr); std::unique_ptr<File> file(new File); - if (!file->Open(name, flags, 0666)) { + if (!file->Open(name, flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) { return nullptr; } return file.release();