summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Tanous <ed.tanous@intel.com>2018-11-12 11:37:44 -0800
committerMatt Spinler <spinler@us.ibm.com>2018-11-26 21:17:51 +0000
commitd4dd96a0386fa4d3a6abe8602f5404422db8e547 (patch)
treeda6e2ad4578be11d7f713e515094182b9af175b8
parent50232cd4041ae0eb365ab381d4015410e52ed842 (diff)
downloadphosphor-objmgr-d4dd96a0386fa4d3a6abe8602f5404422db8e547.tar.gz
phosphor-objmgr-d4dd96a0386fa4d3a6abe8602f5404422db8e547.zip
Remove interface filter
There are a number of cases where the interface filter causes some confusion. Not exposing org.freedesktop.DBus.ObjectManager interfaces caused some confusion around collections of objects, and the ability to search for sensors. Also, objects where the "parent" object has no useful interfaces leads to some question about how things like GetSubTree should behave in this condition. This patchset removes the interface filter alltogether. The only negatives should be a slightly increased memory usage, and extra interface support in mapperx. On a positive, it makes it a lot less likely to see bugs where the blacklists are concerned. Change-Id: I1ffd17106d0c659dd2f438fe25c2d6832a248987 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
-rw-r--r--src/main.cpp24
1 files changed, 7 insertions, 17 deletions
diff --git a/src/main.cpp b/src/main.cpp
index eb97caa..95c9acd 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -45,7 +45,6 @@ boost::container::flat_map<
static boost::container::flat_set<std::string> service_whitelist;
static boost::container::flat_set<std::string> service_blacklist;
-static boost::container::flat_set<std::string> iface_whitelist;
/** Exception thrown when a path is not found in the object list. */
struct NotFoundException final : public sdbusplus::exception_t
@@ -171,10 +170,6 @@ struct InProgressIntrospect
#endif
};
-static const boost::container::flat_set<std::string> ignored_interfaces{
- "org.freedesktop.DBus.Introspectable", "org.freedesktop.DBus.Peer",
- "org.freedesktop.DBus.Properties"};
-
void addAssociation(sdbusplus::asio::object_server& objectServer,
const std::vector<Association>& associations,
const std::string& path)
@@ -353,17 +348,8 @@ void do_introspect(sdbusplus::asio::connection* system_bus,
std::string iface{iface_name};
- if (((ignored_interfaces.find(iface) ==
- ignored_interfaces.end()) &&
- (std::find_if(iface_whitelist.begin(),
- iface_whitelist.end(),
- [iface](const auto& prefix) {
- return boost::starts_with(iface, prefix);
- }) != iface_whitelist.end())) ||
- (iface == "org.freedesktop.DBus.ObjectManager"))
- {
- thisPathMap[transaction->process_name].emplace(iface_name);
- }
+ thisPathMap[transaction->process_name].emplace(iface_name);
+
if (std::strcmp(iface_name, ASSOCIATIONS_INTERFACE) == 0)
{
do_associations(system_bus, objectServer,
@@ -551,9 +537,13 @@ int main(int argc, char** argv)
std::make_shared<sdbusplus::asio::connection>(io);
splitArgs(options["service-namespaces"], service_whitelist);
- splitArgs(options["interface-namespaces"], iface_whitelist);
splitArgs(options["service-blacklists"], service_blacklist);
+ // TODO(Ed) Remove this once all service files are updated to not use this.
+ // For now, simply squash the input, and ignore it.
+ boost::container::flat_set<std::string> iface_whitelist;
+ splitArgs(options["interface-namespaces"], iface_whitelist);
+
system_bus->request_name(OBJECT_MAPPER_DBUS_NAME);
sdbusplus::asio::object_server server(system_bus);
OpenPOWER on IntegriCloud