naming: be inclusive
Adhere to the project inclusive naming guidelines and also adhere to the
OpenBMC style guidelines.
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Change-Id: I5a365049b6fb27236dd55c8455fe13a4a9e7fd31
diff --git a/src/argument.cpp b/src/argument.cpp
index 80bddef..b656deb 100644
--- a/src/argument.cpp
+++ b/src/argument.cpp
@@ -73,9 +73,9 @@
std::cerr << "Options:" << std::endl;
std::cerr << " --help Print this menu" << std::endl;
std::cerr << " --service-namespaces=<services> Space separated list of ";
- std::cerr << "service namespaces to whitelist\n";
+ std::cerr << "service namespaces to allow\n";
std::cerr << " --service-blacklists=<services> Space separated list of ";
- std::cerr << "service names to blacklist\n";
+ std::cerr << "service names to deny\n";
std::cerr << " --interface-namespaces=<ifaces> Space separated list of ";
- std::cerr << "interface namespaces to whitelist\n";
+ std::cerr << "interface namespaces to allow\n";
}
diff --git a/src/main.cpp b/src/main.cpp
index 5fb93b2..f1e06de 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -20,8 +20,8 @@
AssociationMaps associationMaps;
-static WhiteBlackList service_whitelist;
-static WhiteBlackList service_blacklist;
+static AllowDenyList serviceAllowList;
+static AllowDenyList serviceDenyList;
void update_owners(sdbusplus::asio::connection* conn,
boost::container::flat_map<std::string, std::string>& owners,
@@ -242,7 +242,7 @@
#endif
sdbusplus::asio::object_server& objectServer)
{
- if (needToIntrospect(process_name, service_whitelist, service_blacklist))
+ if (needToIntrospect(process_name, serviceAllowList, serviceDenyList))
{
std::shared_ptr<InProgressIntrospect> transaction =
std::make_shared<InProgressIntrospect>(system_bus, io, process_name,
@@ -305,8 +305,8 @@
#endif
for (const std::string& process_name : process_names)
{
- if (needToIntrospect(process_name, service_whitelist,
- service_blacklist))
+ if (needToIntrospect(process_name, serviceAllowList,
+ serviceDenyList))
{
start_new_introspect(system_bus, io, interface_map,
process_name, assocMaps,
@@ -637,13 +637,13 @@
std::shared_ptr<sdbusplus::asio::connection> system_bus =
std::make_shared<sdbusplus::asio::connection>(io);
- splitArgs(options["service-namespaces"], service_whitelist);
- splitArgs(options["service-blacklists"], service_blacklist);
+ splitArgs(options["service-namespaces"], serviceAllowList);
+ splitArgs(options["service-blacklists"], serviceDenyList);
// 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);
+ boost::container::flat_set<std::string> ifaceAllowlist;
+ splitArgs(options["interface-namespaces"], ifaceAllowlist);
sdbusplus::asio::object_server server(system_bus);
@@ -678,8 +678,7 @@
std::chrono::steady_clock::now());
#endif
// New daemon added
- if (needToIntrospect(name, service_whitelist,
- service_blacklist))
+ if (needToIntrospect(name, serviceAllowList, serviceDenyList))
{
name_owners[new_owner] = name;
start_new_introspect(system_bus.get(), io, interface_map,
@@ -707,8 +706,7 @@
{
return; // only introspect well-known
}
- if (needToIntrospect(well_known, service_whitelist,
- service_blacklist))
+ if (needToIntrospect(well_known, serviceAllowList, serviceDenyList))
{
processInterfaceAdded(interface_map, obj_path, interfaces_added,
well_known, associationMaps, server);
diff --git a/src/processing.cpp b/src/processing.cpp
index 19f36a8..255433c 100644
--- a/src/processing.cpp
+++ b/src/processing.cpp
@@ -25,19 +25,19 @@
}
bool needToIntrospect(const std::string& processName,
- const WhiteBlackList& whiteList,
- const WhiteBlackList& blackList)
+ const AllowDenyList& allowList,
+ const AllowDenyList& denyList)
{
- auto inWhitelist =
- std::find_if(whiteList.begin(), whiteList.end(),
+ auto inAllowList =
+ std::find_if(allowList.begin(), allowList.end(),
[&processName](const auto& prefix) {
return boost::starts_with(processName, prefix);
- }) != whiteList.end();
+ }) != allowList.end();
// This holds full service names, not prefixes
- auto inBlacklist = blackList.find(processName) != blackList.end();
+ auto inDenyList = denyList.find(processName) != denyList.end();
- return inWhitelist && !inBlacklist;
+ return inAllowList && !inDenyList;
}
void processNameChangeDelete(
diff --git a/src/processing.hpp b/src/processing.hpp
index 0810312..1569c32 100644
--- a/src/processing.hpp
+++ b/src/processing.hpp
@@ -9,8 +9,8 @@
#include <cassert>
#include <string>
-/** @brief Define white list and black list data structure */
-using WhiteBlackList = boost::container::flat_set<std::string>;
+/** @brief Define allow list and deny list data structure */
+using AllowDenyList = boost::container::flat_set<std::string>;
/** @brief The associations definitions interface */
constexpr const char* assocDefsInterface =
@@ -45,19 +45,19 @@
/** @brief Determine if dbus service is something to monitor
*
- * mapper supports a whitelist and blacklist concept. If a whitelist is provided
- * as input then only dbus objects matching that list is monitored. If a
- * blacklist is provided then objects matching it will not be monitored.
+ * mapper supports an allowlist and denylist concept. If an allowlist is
+ * provided as input then only dbus objects matching that list is monitored. If
+ * a denylist is provided then objects matching it will not be monitored.
*
* @param[in] processName - Dbus service name
- * @param[in] whiteList - The white list
- * @param[in] blackList - The black list
+ * @param[in] allowList - The allow list
+ * @param[in] denyList - The deny list
*
* @return True if input process_name should be monitored, false otherwise
*/
bool needToIntrospect(const std::string& processName,
- const WhiteBlackList& whiteList,
- const WhiteBlackList& blackList);
+ const AllowDenyList& allowList,
+ const AllowDenyList& denyList);
/** @brief Handle the removal of an existing name in objmgr data structures
*
diff --git a/src/test/need_to_introspect.cpp b/src/test/need_to_introspect.cpp
index 6912619..51972ef 100644
--- a/src/test/need_to_introspect.cpp
+++ b/src/test/need_to_introspect.cpp
@@ -5,39 +5,39 @@
// Verify if name is empty, false is returned
TEST(NeedToIntrospect, PassEmptyName)
{
- WhiteBlackList whiteList;
- WhiteBlackList blackList;
+ AllowDenyList allowList;
+ AllowDenyList denyList;
std::string process_name;
- EXPECT_FALSE(needToIntrospect(process_name, whiteList, blackList));
+ EXPECT_FALSE(needToIntrospect(process_name, allowList, denyList));
}
-// Verify if name is on whitelist, true is returned
-TEST(NeedToIntrospect, ValidWhiteListName)
+// Verify if name is on allowlist, true is returned
+TEST(NeedToIntrospect, ValidAllowListName)
{
- WhiteBlackList whiteList = {"xyz.openbmc_project"};
- WhiteBlackList blackList;
+ AllowDenyList allowList = {"xyz.openbmc_project"};
+ AllowDenyList denyList;
std::string process_name = "xyz.openbmc_project.State.Host";
- EXPECT_TRUE(needToIntrospect(process_name, whiteList, blackList));
+ EXPECT_TRUE(needToIntrospect(process_name, allowList, denyList));
}
-// Verify if name is on blacklist, false is returned
-TEST(NeedToIntrospect, ValidBlackListName)
+// Verify if name is on denylist, false is returned
+TEST(NeedToIntrospect, ValidDenyListName)
{
- WhiteBlackList whiteList;
- WhiteBlackList blackList = {"xyz.openbmc_project.State.Host"};
+ AllowDenyList allowList;
+ AllowDenyList denyList = {"xyz.openbmc_project.State.Host"};
std::string process_name = "xyz.openbmc_project.State.Host";
- EXPECT_FALSE(needToIntrospect(process_name, whiteList, blackList));
+ EXPECT_FALSE(needToIntrospect(process_name, allowList, denyList));
}
-// Verify if name is on whitelist and blacklist, false is returned
-TEST(NeedToIntrospect, ValidWhiteAndBlackListName)
+// Verify if name is on allowlist and denylist, false is returned
+TEST(NeedToIntrospect, ValidAllowAndDenyListName)
{
- WhiteBlackList whiteList = {"xyz.openbmc_project"};
- WhiteBlackList blackList = {"xyz.openbmc_project.State.Host"};
+ AllowDenyList allowList = {"xyz.openbmc_project"};
+ AllowDenyList denyList = {"xyz.openbmc_project.State.Host"};
std::string process_name = "xyz.openbmc_project.State.Host";
- EXPECT_FALSE(needToIntrospect(process_name, whiteList, blackList));
+ EXPECT_FALSE(needToIntrospect(process_name, allowList, denyList));
}