diff options
author | Ratan Gupta <ratagupt@linux.vnet.ibm.com> | 2019-02-18 20:34:10 +0530 |
---|---|---|
committer | Ratan Gupta <ratagupt@linux.vnet.ibm.com> | 2019-03-11 12:10:22 +0530 |
commit | 95a2931473dfa61a30e7a65606dab15ab24cd5b4 (patch) | |
tree | 489495eee9fde8aa5254dd515305214779df0301 /phosphor-ldap-config/ldap_serialize.hpp | |
parent | aeaf9413a965d225d11ee1cd2c8ee9aa1f8dc862 (diff) | |
download | phosphor-user-manager-95a2931473dfa61a30e7a65606dab15ab24cd5b4.tar.gz phosphor-user-manager-95a2931473dfa61a30e7a65606dab15ab24cd5b4.zip |
LDAP: Add the persistency for the "Enabled" property
This property will control that whether the LDAP service would
be started or not.
We are persisting this property using cereal, other properties
is being persisted through nslcd.conf, nslcd doesn't give us
a way to put this property under nslcd.conf.
Tested By:
Test the persistency of enabled property.
Verified that it was getting persisted across restart/reboot.
Change-Id: Id64b23b71865bac15d3be2d79abad615aa576bea
Signed-off-by: Ratan Gupta <ratagupt@linux.vnet.ibm.com>
Diffstat (limited to 'phosphor-ldap-config/ldap_serialize.hpp')
-rw-r--r-- | phosphor-ldap-config/ldap_serialize.hpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/phosphor-ldap-config/ldap_serialize.hpp b/phosphor-ldap-config/ldap_serialize.hpp new file mode 100644 index 0000000..b784baf --- /dev/null +++ b/phosphor-ldap-config/ldap_serialize.hpp @@ -0,0 +1,29 @@ +#pragma once + +#include <filesystem> +#include "ldap_configuration.hpp" + +namespace phosphor +{ +namespace ldap +{ + +namespace fs = std::filesystem; + +/** @brief Serialize and persist LDAP service status property. + * @param[in] config - const reference to LDAP config object. + * @param[in] path - path of persistent location where D-Bus property would be + * saved. + * @return fs::path - pathname of persisted LDAP Config file. + */ +fs::path serialize(const Config& config, const fs::path& path); + +/** @brief Deserialize LDAP service status into a D-Bus object + * @param[in] path - pathname of persisted LDAP Config file. + * @param[in] config - reference of the object which needs to be deserialized. + * @return bool - true if the deserialization was successful, false otherwise. + */ +bool deserialize(const fs::path& path, Config& config); + +} // namespace ldap +} // namespace phosphor |