summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNagaraju Goruganti <ngorugan@in.ibm.com>2018-10-05 07:03:05 -0500
committerNagaraju Goruganti <ngorugan@in.ibm.com>2018-10-23 23:17:15 -0500
commit156754745b44c341c54febab526e3b0d9b5d118f (patch)
tree5f97c3d009e4d8f6b108373aec0991baed649548
parent045b11231d53983577c4448f08d41d19b36409cb (diff)
downloadphosphor-user-manager-156754745b44c341c54febab526e3b0d9b5d118f.zip
phosphor-user-manager-156754745b44c341c54febab526e3b0d9b5d118f.tar.gz
phosphor-ldap-conf: add support for anonymous bind
Add "bindpw <password>" entry into nslcd.conf file only if given password is not null. Change-Id: Ifa4a90c6fd41d5b36c62328dcf3e9bfc38dd0ebb Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
-rw-r--r--phosphor-ldap-config/ldap_configuration.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/phosphor-ldap-config/ldap_configuration.cpp b/phosphor-ldap-config/ldap_configuration.cpp
index e3b337d..c84927d 100644
--- a/phosphor-ldap-config/ldap_configuration.cpp
+++ b/phosphor-ldap-config/ldap_configuration.cpp
@@ -79,7 +79,11 @@ void Config::writeConfig()
confData << "uri " << lDAPServerURI() << "\n\n";
confData << "base " << lDAPBaseDN() << "\n\n";
confData << "binddn " << lDAPBindDN() << "\n";
- confData << "bindpw " << lDAPBINDDNpassword() << "\n\n";
+ if (!lDAPBINDDNpassword().empty())
+ {
+ confData << "bindpw " << lDAPBINDDNpassword() << "\n";
+ }
+ confData << "\n";
switch (lDAPSearchScope())
{
case ldap_base::Config::SearchScope::sub:
@@ -102,8 +106,9 @@ void Config::writeConfig()
}
else
{
- confData << "ssl off\n\n";
+ confData << "ssl off\n";
}
+ confData << "\n";
if (lDAPType() == ldap_base::Config::Type::ActiveDirectory)
{
confData << "filter passwd (&(objectClass=user)(objectClass=person)"
OpenPOWER on IntegriCloud