summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEd Tanous <edtanous@google.com>2023-06-06 21:46:49 +0300
committerEd Tanous <ed@tanous.net>2023-06-08 19:39:49 +0300
commitf9c794fbf2053c664902efa5d9ef638ef08acb38 (patch)
tree989875f90035b2c7207017cf0471d05a5256970e /include
parent9ba73934501fc4bfe8edf74b8a0211701b6d58ca (diff)
downloadbmcweb-f9c794fbf2053c664902efa5d9ef638ef08acb38.tar.xz
Remove unused const-cast
std::string::data now has a non-const variation in c++20. This allows us to remove a NOLINT and follow the standard. Tested: Login succeeds. Change-Id: Ie49932fae8efa90afe1a238f7059924747300521 Signed-off-by: Ed Tanous <edtanous@google.com>
Diffstat (limited to 'include')
-rw-r--r--include/pam_authenticate.hpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/include/pam_authenticate.hpp b/include/pam_authenticate.hpp
index 4759e02eda..c06b7e9681 100644
--- a/include/pam_authenticate.hpp
+++ b/include/pam_authenticate.hpp
@@ -92,8 +92,7 @@ inline int pamAuthenticateUser(std::string_view username,
std::string userStr(username);
std::string passStr(password);
- // NOLINTNEXTLINE(cppcoreguidelines-pro-type-const-cast)
- char* passStrNoConst = const_cast<char*>(passStr.c_str());
+ char* passStrNoConst = passStr.data();
const struct pam_conv localConversation = {pamFunctionConversation,
passStrNoConst};
pam_handle_t* localAuthHandle = nullptr; // this gets set by pam_start