Allow disabling SSH
The intent behind this commit is to add the dropbear service, monitor
the Enabled and Running properties, and then update the
dropbear.socket to allow disabling/enabling SSH.
Tested:
1.
busctl introspect xyz.openbmc_project.Control.Service.Manager /xyz/openbmc_project/control/service/dropbear
xyz.openbmc_project.Control.Service.Attributes interface
.Enabled property b false emits-change writable
.Masked property b false emits-change writable
.Running property b true emits-change writable
Open a new SSH connection:
sudo ssh username@<IP>
Successfully connected
2.
busctl set-property xyz.openbmc_project.Control.Service.Manager /xyz/openbmc_project/control/service/dropbear xyz.openbmc_project.Control.Service.Attributes Running b false
busctl introspect xyz.openbmc_project.Control.Service.Manager /xyz/openbmc_project/control/service/dropbear
xyz.openbmc_project.Control.Service.Attributes interface
.Enabled property b false emits-change writable
.Masked property b false emits-change writable
.Running property b false emits-change writable
Open a new SSH connection:
sudo ssh username@<IP>
ssh: connect to host <IP> port 22: Connection refused
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I5d004f7f49c25fc90b93dabd124fe0d3d93ca822
diff --git a/src/utils.cpp b/src/utils.cpp
index b4ed9f7..0eba710 100644
--- a/src/utils.cpp
+++ b/src/utils.cpp
@@ -15,8 +15,8 @@
*/
#include "utils.hpp"
-static inline void checkAndThrowInternalFailure(boost::system::error_code& ec,
- const std::string& msg)
+void checkAndThrowInternalFailure(boost::system::error_code& ec,
+ const std::string& msg)
{
if (ec)
{