]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: don't leak S3 LDAPHelper on shutdown 12427/head
authorMatt Benjamin <mbenjamin@redhat.com>
Tue, 2 Jan 2018 19:16:11 +0000 (14:16 -0500)
committerMatt Benjamin <mbenjamin@redhat.com>
Tue, 2 Jan 2018 19:16:11 +0000 (14:16 -0500)
Adds a static shutdown() method to rgw::auth::s3::LDAPEngine, and
calls it from main.

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
src/rgw/rgw_main.cc
src/rgw/rgw_rest_s3.cc
src/rgw/rgw_rest_s3.h

index aaa57ae0ef314fb07463fe3cf90989d57a129a7a..b742d2e5673f7ee1aa674028e38459a813a51a90 100644 (file)
@@ -568,7 +568,7 @@ int main(int argc, const char **argv)
   delete olog;
 
   RGWStoreManager::close_storage(store);
-
+  rgw::auth::s3::LDAPEngine::shutdown();
   rgw_tools_cleanup();
   rgw_shutdown_resolver();
   curl_global_cleanup();
index 93a20087d607e3d74336e4ec6a1bf7db92e8a713..0321c6e98315da7ffa06979ca1bb0010ab253fc4 100644 (file)
@@ -4137,8 +4137,14 @@ rgw::auth::s3::LDAPEngine::authenticate(
   auto apl = apl_factory->create_apl_remote(cct, s, get_acl_strategy(),
                                             get_creds_info(base64_token));
   return result_t::grant(std::move(apl), completer_factory(boost::none));
-}
+} /* rgw::auth::s3::LDAPEngine::authenticate */
 
+void rgw::auth::s3::LDAPEngine::shutdown() {
+  if (ldh) {
+    delete ldh;
+    ldh = nullptr;
+  }
+}
 
 /* LocalEndgine */
 rgw::auth::Engine::result_t
index 65b2052873374ab5d85d5a9d82b3f93c10106539..20c4b2d669324264e4c9cf13cd32a8ca10739880 100644 (file)
@@ -850,6 +850,8 @@ public:
   const char* get_name() const noexcept override {
     return "rgw::auth::s3::LDAPEngine";
   }
+
+  static void shutdown();
 };