netipmid: Make pam_auth configurable
Allow people to disable pam_authenticate if it is not working for their
system.
Tested:
Testing on a system with no dropbear and was able to pass the check.
Change-Id: I932830cd518b7f8ef6c828405b4959a8d14b1b58
Signed-off-by: Willy Tu <wltu@google.com>
diff --git a/command/rakp12.cpp b/command/rakp12.cpp
index c72611e..bcdcc35 100644
--- a/command/rakp12.cpp
+++ b/command/rakp12.cpp
@@ -1,3 +1,5 @@
+#include "config.h"
+
#include "rakp12.hpp"
#include "comm_module.hpp"
@@ -204,6 +206,7 @@
logInvalidLoginRedfishEvent(message);
return outPayload;
}
+#ifdef PAM_AUTHENTICATE
// Check whether user is already locked for failed attempts
if (!ipmi::ipmiUserPamAuthenticate(userName, passwd))
{
@@ -216,6 +219,7 @@
logInvalidLoginRedfishEvent(message);
return outPayload;
}
+#endif
uint8_t chNum = static_cast<uint8_t>(getInterfaceIndex());
// Get channel based access information
diff --git a/meson.build b/meson.build
index 05aa623..44eff6f 100644
--- a/meson.build
+++ b/meson.build
@@ -12,6 +12,7 @@
conf_data = configuration_data()
conf_data.set('RMCP_PING', get_option('rmcp_ping').enabled())
+conf_data.set('PAM_AUTHENTICATE', get_option('pam_authenticate').enabled())
configure_file(output: 'config.h',
configuration: conf_data
diff --git a/meson_options.txt b/meson_options.txt
index 097dc52..bad5e62 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -11,3 +11,10 @@
value: 'enabled',
description : 'Enable RMCP Ping support'
)
+
+option(
+ 'pam_authenticate',
+ type : 'feature',
+ value: 'enabled',
+ description : 'Enable Pam Authenticate'
+)