From eb1780981252f05c792a1e40b7d0471f5b670ef5 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 30 Dec 2009 11:55:23 +0100 Subject: s3:ntlmssp: pass names to ntlmssp_server_start() and store them in ntlmssp_state MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Inspired by the NTLMSSP merge work by Andrew Bartlett. metze Signed-off-by: Günther Deschner --- source3/utils/ntlm_auth.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'source3/utils/ntlm_auth.c') diff --git a/source3/utils/ntlm_auth.c b/source3/utils/ntlm_auth.c index e018c28c30..487401b662 100644 --- a/source3/utils/ntlm_auth.c +++ b/source3/utils/ntlm_auth.c @@ -688,8 +688,34 @@ static NTSTATUS ntlm_auth_start_ntlmssp_client(struct ntlmssp_state **client_ntl static NTSTATUS ntlm_auth_start_ntlmssp_server(struct ntlmssp_state **ntlmssp_state) { - NTSTATUS status = ntlmssp_server_start(ntlmssp_state); + NTSTATUS status; + const char *netbios_name; + const char *netbios_domain; + const char *dns_name; + char *dns_domain; + bool is_standalone = false; + if (opt_password) { + netbios_name = global_myname(); + netbios_domain = lp_workgroup(); + } else { + netbios_name = get_winbind_netbios_name(); + netbios_domain = get_winbind_domain(); + } + /* This should be a 'netbios domain -> DNS domain' mapping */ + dns_domain = get_mydnsdomname(talloc_tos()); + if (dns_domain) { + strlower_m(dns_domain); + } + dns_name = get_mydnsfullname(); + + status = ntlmssp_server_start(NULL, + is_standalone, + netbios_name, + netbios_domain, + dns_name, + dns_domain, + ntlmssp_state); if (!NT_STATUS_IS_OK(status)) { DEBUG(1, ("Could not start NTLMSSP server: %s\n", nt_errstr(status))); -- cgit