2018-11-30 18:39:55 +03:00
|
|
|
/* vim:set ts=4 sw=2 et cindent: */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-03-08 04:48:25 +03:00
|
|
|
|
|
|
|
#ifndef nsAuthSambaNTLM_h__
|
|
|
|
#define nsAuthSambaNTLM_h__
|
|
|
|
|
|
|
|
#include "nsIAuthModule.h"
|
|
|
|
#include "nsString.h"
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "prio.h"
|
|
|
|
#include "prproces.h"
|
2012-06-13 07:13:31 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
2007-03-08 04:48:25 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This is an implementation of NTLM authentication that does single-signon
|
|
|
|
* by obtaining the user's Unix username, parsing it into DOMAIN\name format,
|
|
|
|
* and then asking Samba's ntlm_auth tool to do the authentication for us
|
|
|
|
* using the user's password cached in winbindd, if available. If the
|
|
|
|
* password is not available then this component fails to instantiate so
|
|
|
|
* nsHttpNTLMAuth will fall back to a different NTLM implementation.
|
|
|
|
* NOTE: at time of writing, this requires patches to be added to the stock
|
|
|
|
* Samba winbindd and ntlm_auth!
|
|
|
|
*/
|
2015-03-21 19:28:04 +03:00
|
|
|
class nsAuthSambaNTLM final : public nsIAuthModule {
|
2007-03-08 04:48:25 +03:00
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIAUTHMODULE
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2007-03-08 04:48:25 +03:00
|
|
|
nsAuthSambaNTLM();
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2007-03-08 04:48:25 +03:00
|
|
|
// We spawn the ntlm_auth helper from the module constructor, because
|
|
|
|
// that lets us fail to instantiate the module if ntlm_auth isn't
|
|
|
|
// available, triggering fallback to the built-in NTLM support (which
|
|
|
|
// doesn't support single signon, of course)
|
|
|
|
nsresult SpawnNTLMAuthHelper();
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2007-03-08 04:48:25 +03:00
|
|
|
private:
|
|
|
|
~nsAuthSambaNTLM();
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2007-03-08 04:48:25 +03:00
|
|
|
void Shutdown();
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
uint8_t* mInitialMessage; /* free with free() */
|
2021-05-06 17:37:17 +03:00
|
|
|
uint32_t mInitialMessageLen;
|
2007-03-08 04:48:25 +03:00
|
|
|
PRProcess* mChildPID;
|
|
|
|
PRFileDesc* mFromChildFD;
|
|
|
|
PRFileDesc* mToChildFD;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* nsAuthSambaNTLM_h__ */
|