Use built-in sd-bus methods for member name check
sd-bus has built-in methods for verifying member names that do a better
job checking than the method that was created here. Use them.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I5b5389abf7f3033f3f4de344118bf9049d81be66
diff --git a/include/sdbusplus/asio/object_server.hpp b/include/sdbusplus/asio/object_server.hpp
index 82c3315..45f3e4f 100644
--- a/include/sdbusplus/asio/object_server.hpp
+++ b/include/sdbusplus/asio/object_server.hpp
@@ -27,9 +27,6 @@
namespace asio
{
-constexpr const char* PropertyNameAllowedCharacters =
- "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_";
-
class callback
{
public:
@@ -366,8 +363,7 @@
{
return false;
}
- if (name.find_first_not_of(PropertyNameAllowedCharacters) !=
- std::string::npos)
+ if (sd_bus_member_name_is_valid(name.c_str()) != 1)
{
return false;
}
@@ -416,8 +412,7 @@
{
return false;
}
- if (name.find_first_not_of(PropertyNameAllowedCharacters) !=
- std::string::npos)
+ if (sd_bus_member_name_is_valid(name.c_str()) != 1)
{
return false;
}
@@ -538,8 +533,7 @@
{
return false;
}
- if (name.find_first_not_of(PropertyNameAllowedCharacters) !=
- std::string::npos)
+ if (sd_bus_member_name_is_valid(name.c_str()) != 1)
{
return false;
}