diff options
| author | Tom Cherry <tomcherry@google.com> | 2018-02-28 10:39:01 -0800 |
|---|---|---|
| committer | Tom Cherry <tomcherry@google.com> | 2018-03-01 11:17:07 -0800 |
| commit | dc375869abb56a0ef8ee1299443866da1e76abb6 (patch) | |
| tree | e03e34ce5f5aaca6196be9ba7a03241c91122b4b /init/subcontext.cpp | |
| parent | 69d47aa829fa5a48baeadeff0e04d03e58f147b7 (diff) | |
| download | core-dc375869abb56a0ef8ee1299443866da1e76abb6.tar.gz core-dc375869abb56a0ef8ee1299443866da1e76abb6.tar.bz2 core-dc375869abb56a0ef8ee1299443866da1e76abb6.zip | |
Restrict setting platform properties from vendor .prop files
We should only allow vendor-init-settable properties to be set from
.prop files on /vendor and /odm.
Bug: 73905119
Test: test on walleye that disallowed properties are rejected
Change-Id: I2a5d244fdc71060ddda3e3d87442e831e6b97831
Diffstat (limited to 'init/subcontext.cpp')
| -rw-r--r-- | init/subcontext.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/init/subcontext.cpp b/init/subcontext.cpp index 762492c87..c1846f76d 100644 --- a/init/subcontext.cpp +++ b/init/subcontext.cpp @@ -49,6 +49,11 @@ namespace init { const std::string kInitContext = "u:r:init:s0"; const std::string kVendorContext = "u:r:vendor_init:s0"; +const char* const paths_and_secontexts[2][2] = { + {"/vendor", kVendorContext.c_str()}, + {"/odm", kVendorContext.c_str()}, +}; + namespace { constexpr size_t kBufferSize = 4096; @@ -349,9 +354,6 @@ Result<std::vector<std::string>> Subcontext::ExpandArgs(const std::vector<std::s static std::vector<Subcontext> subcontexts; std::vector<Subcontext>* InitializeSubcontexts() { - static const char* const paths_and_secontexts[][2] = { - {"/vendor", kVendorContext.c_str()}, - }; for (const auto& [path_prefix, secontext] : paths_and_secontexts) { subcontexts.emplace_back(path_prefix, secontext); } |
