#if HAVE_AUTH_MODULE_NEGOTIATE
#include "auth/negotiate/Scheme.h"
#endif
-#if HAVE_AUTH_MODULE_NTLM
-#include "auth/ntlm/Scheme.h"
-#endif
#include "debug/Stream.h"
static const char *negotiate_type = Auth::Negotiate::Scheme::GetInstance()->type();
debugs(29,DBG_IMPORTANT,"Startup: Initialized Authentication Scheme '" << negotiate_type << "'");
#endif
-#if HAVE_AUTH_MODULE_NTLM
- static const char *ntlm_type = Auth::Ntlm::Scheme::GetInstance()->type();
- debugs(29,DBG_IMPORTANT,"Startup: Initialized Authentication Scheme '" << ntlm_type << "'");
-#endif
- debugs(29,DBG_IMPORTANT,"Startup: Initialized Authentication.");
}
#endif /* USE_AUTH */
#include "squid.h"
#include "auth/ntlm/Config.h"
#include "auth/ntlm/Scheme.h"
+#include "base/RunnersRegistry.h"
#include "debug/Messages.h"
#include "debug/Stream.h"
#include "helper.h"
-Auth::Scheme::Pointer Auth::Ntlm::Scheme::_instance = NULL;
+class NtlmAuthRr : public RegisteredRunner
+{
+public:
+ /* RegisteredRunner API */
+ virtual void bootstrapConfig() override {
+ const char *type = Auth::Ntlm::Scheme::GetInstance()->type();
+ debugs(29, 2, "Initialized Authentication Scheme '" << type << "'");
+ }
+};
+RunnerRegistrationEntry(NtlmAuthRr);
Auth::Scheme::Pointer
Auth::Ntlm::Scheme::GetInstance()
{
- if (_instance == NULL) {
+ static Auth::Scheme::Pointer _instance;
+
+ if (!_instance) {
_instance = new Auth::Ntlm::Scheme();
AddScheme(_instance);
}
void
Auth::Ntlm::Scheme::shutdownCleanup()
{
- if (_instance == NULL)
- return;
-
- _instance = NULL;
- debugs(29, Critical(61), "Shutdown: NTLM authentication.");
+ // TODO: destruct any active Ntlm::Config objects via runner
+ debugs(29, 2, "Shutdown: NTLM authentication.");
}
Auth::SchemeConfig *
/* Not implemented */
Scheme (Scheme const &);
Scheme &operator=(Scheme const &);
-
-private:
- /**
- * Main instance of this authentication Scheme.
- * NULL when the scheme is not being used.
- */
- static Auth::Scheme::Pointer _instance;
};
} // namespace Ntlm