diff options
Diffstat (limited to 'phosphor-ldap-config')
-rw-r--r-- | phosphor-ldap-config/ldap_configuration.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/phosphor-ldap-config/ldap_configuration.cpp b/phosphor-ldap-config/ldap_configuration.cpp index 5582bf1..3e31e41 100644 --- a/phosphor-ldap-config/ldap_configuration.cpp +++ b/phosphor-ldap-config/ldap_configuration.cpp @@ -540,6 +540,18 @@ void ConfigMgr::restore(const char* filePath) lDAPType = ldap_base::Create::Type::OpenLdap; } + // Don't create the config object if either of the field is empty. + if (configValues["uri"] == "" || configValues["binddn"] == "" || + configValues["base"] == "") + { + log<level::INFO>( + "LDAP config parameter value missing", + entry("URI=%s", configValues["uri"].c_str()), + entry("BASEDN=%s", configValues["base"].c_str()), + entry("BINDDN=%s", configValues["binddn"].c_str())); + return; + } + createConfig( std::move(configValues["uri"]), std::move(configValues["binddn"]), std::move(configValues["base"]), std::move(configValues["bindpw"]), |