]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: udpate options yaml file so LDAP uri isn't an invalid example 56722/head
authorJ. Eric Ivancich <ivancich@redhat.com>
Wed, 3 Apr 2024 03:10:12 +0000 (23:10 -0400)
committerJ. Eric Ivancich <ivancich@redhat.com>
Fri, 5 Apr 2024 00:01:28 +0000 (20:01 -0400)
LDAP tries to bind the URI configuration option when RGW starts. The
default value is an example used to show the form of the URI and is
not itself valid. The default value is used, unless overrideen, and
can cause delays in start-up in some situations. The example is now
provided in the description and the default is the empty string.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
(cherry picked from commit 236f1dfa9ae507940a53301f31da7974456c82fe)

Conflicts:
    src/rgw/librgw.cc
        - changes here were in rgw_appmain.cc in main branch

src/common/options/rgw.yaml.in
src/rgw/librgw.cc

index e82a0147b1caa605c6009bf4dea77a861ae4dff2..8f1b14ff72c8c34203bd827828ca3b940445615f 100644 (file)
@@ -883,8 +883,8 @@ options:
 - name: rgw_ldap_uri
   type: str
   level: advanced
-  desc: Space-separated list of LDAP servers in URI format.
-  default: ldaps://<ldap.your.domain>
+  desc: Space-separated list of LDAP servers in URI format, e.g., "ldaps://<ldap.your.domain>".
+  default:
   services:
   - rgw
   with_legacy: true
index 6f030f8e5016eaa9c433a98f71fa989e1a75e2d8..e45ebed8c6102be4eff66bc165aa351d4b466a97 100644 (file)
@@ -579,10 +579,12 @@ namespace rgw {
       store->ctx()->_conf->rgw_ldap_dnattr;
     std::string ldap_bindpw = parse_rgw_ldap_bindpw(store->ctx());
 
-    ldh = new rgw::LDAPHelper(ldap_uri, ldap_binddn, ldap_bindpw.c_str(),
-                             ldap_searchdn, ldap_searchfilter, ldap_dnattr);
-    ldh->init();
-    ldh->bind();
+    if (! ldap_uri.empty()) {
+      ldh = new rgw::LDAPHelper(ldap_uri, ldap_binddn, ldap_bindpw.c_str(),
+                               ldap_searchdn, ldap_searchfilter, ldap_dnattr);
+      ldh->init();
+      ldh->bind();
+    }
 
     rgw_log_usage_init(g_ceph_context, store);