Skip to content

Commit 378890f

Browse files
authored
Merge pull request ceph#56645 from ivancich/wip-remove-example-ldap-domain
rgw: udpate options yaml file so LDAP uri isn't an invalid example Reviewed-by: Daniel Gryniewicz <[email protected]>
2 parents c8f52dc + 236f1df commit 378890f

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/common/options/rgw.yaml.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -913,8 +913,8 @@ options:
913913
- name: rgw_ldap_uri
914914
type: str
915915
level: advanced
916-
desc: Space-separated list of LDAP servers in URI format.
917-
default: ldaps://<ldap.your.domain>
916+
desc: Space-separated list of LDAP servers in URI format, e.g., "ldaps://<ldap.your.domain>".
917+
default:
918918
services:
919919
- rgw
920920
with_legacy: true

src/rgw/rgw_appmain.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,11 @@ void rgw::AppMain::init_ldap()
381381
const string &ldap_dnattr = cct->_conf->rgw_ldap_dnattr;
382382
std::string ldap_bindpw = parse_rgw_ldap_bindpw(cct);
383383

384+
if (ldap_uri.empty()) {
385+
derr << "LDAP not started since no server URIs were provided in the configuration." << dendl;
386+
return;
387+
}
388+
384389
ldh.reset(new rgw::LDAPHelper(ldap_uri, ldap_binddn,
385390
ldap_bindpw.c_str(), ldap_searchdn, ldap_searchfilter, ldap_dnattr));
386391
ldh->init();
@@ -603,7 +608,7 @@ void rgw::AppMain::shutdown(std::function<void(void)> finalize_async_signals)
603608
fe->stop();
604609
}
605610

606-
ldh.reset(nullptr); // deletes
611+
ldh.reset(nullptr); // deletes ldap helper if it was created
607612
rgw_log_usage_finalize();
608613

609614
delete olog;

0 commit comments

Comments
 (0)