diff options
author | Daniel Norman <danielnorman@google.com> | 2019-06-27 12:18:08 -0700 |
---|---|---|
committer | Daniel Norman <danielnorman@google.com> | 2019-06-28 13:31:54 -0700 |
commit | 3df8dc58b2b5b1f60d45793e6a7c1f51a2fd2383 (patch) | |
tree | a888e3b89fc5abe85c0c2f9f7352f7f10424ced2 /init/service_parser.cpp | |
parent | c4117afdc9144e925bfb663d25c15a16b0700842 (diff) |
Checks each interface in an init_rc file is a known hidl_interface.
Test: Adding a misspelling to an init_rc's interface line and observing
build failure.
Bug: 77646540
Change-Id: I58f66d73f0bd9b4203e8259161843b56ad428d73
Diffstat (limited to 'init/service_parser.cpp')
-rw-r--r-- | init/service_parser.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/init/service_parser.cpp b/init/service_parser.cpp index 33ed05097..ba351046a 100644 --- a/init/service_parser.cpp +++ b/init/service_parser.cpp @@ -152,6 +152,12 @@ Result<void> ServiceParser::ParseInterface(std::vector<std::string>&& args) { return Error() << "Interface name must not be a value name '" << interface_name << "'"; } + if (known_interfaces_ && known_interfaces_->count(interface_name) == 0) { + return Error() << "Interface is not in the known set of hidl_interfaces: '" + << interface_name << "'. Please ensure the interface is built " + << "by a hidl_interface target."; + } + const std::string fullname = interface_name + "/" + instance_name; for (const auto& svc : *service_list_) { |