summaryrefslogtreecommitdiff
path: root/source3/auth
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-12-30 11:55:23 +0100
committerGünther Deschner <gd@samba.org>2010-03-24 17:34:54 +0100
commiteb1780981252f05c792a1e40b7d0471f5b670ef5 (patch)
tree66c246bbe420ed1f6bfe44a93cd5471cce39006c /source3/auth
parenteca118614c1431855c88b9f43457c0d2d6502ebe (diff)
downloadsamba-eb1780981252f05c792a1e40b7d0471f5b670ef5.tar.gz
samba-eb1780981252f05c792a1e40b7d0471f5b670ef5.tar.bz2
samba-eb1780981252f05c792a1e40b7d0471f5b670ef5.zip
s3:ntlmssp: pass names to ntlmssp_server_start() and store them in ntlmssp_state
Inspired by the NTLMSSP merge work by Andrew Bartlett. metze Signed-off-by: Günther Deschner <gd@samba.org>
Diffstat (limited to 'source3/auth')
-rw-r--r--source3/auth/auth_ntlmssp.c34
1 files changed, 28 insertions, 6 deletions
diff --git a/source3/auth/auth_ntlmssp.c b/source3/auth/auth_ntlmssp.c
index 9eccebc564..3431d79a3f 100644
--- a/source3/auth/auth_ntlmssp.c
+++ b/source3/auth/auth_ntlmssp.c
@@ -157,6 +157,26 @@ NTSTATUS auth_ntlmssp_start(AUTH_NTLMSSP_STATE **auth_ntlmssp_state)
{
NTSTATUS nt_status;
TALLOC_CTX *mem_ctx;
+ bool is_standalone;
+ const char *netbios_name;
+ const char *netbios_domain;
+ const char *dns_name;
+ char *dns_domain;
+
+ if ((enum server_types)lp_server_role() == ROLE_STANDALONE) {
+ is_standalone = true;
+ } else {
+ is_standalone = false;
+ }
+
+ netbios_name = global_myname();
+ netbios_domain = lp_workgroup();
+ /* 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();
mem_ctx = talloc_init("AUTH NTLMSSP context");
@@ -171,7 +191,14 @@ NTSTATUS auth_ntlmssp_start(AUTH_NTLMSSP_STATE **auth_ntlmssp_state)
(*auth_ntlmssp_state)->mem_ctx = mem_ctx;
- if (!NT_STATUS_IS_OK(nt_status = ntlmssp_server_start(&(*auth_ntlmssp_state)->ntlmssp_state))) {
+ nt_status = ntlmssp_server_start(NULL,
+ is_standalone,
+ netbios_name,
+ netbios_domain,
+ dns_name,
+ dns_domain,
+ &(*auth_ntlmssp_state)->ntlmssp_state);
+ if (!NT_STATUS_IS_OK(nt_status)) {
return nt_status;
}
@@ -184,11 +211,6 @@ NTSTATUS auth_ntlmssp_start(AUTH_NTLMSSP_STATE **auth_ntlmssp_state)
(*auth_ntlmssp_state)->ntlmssp_state->may_set_challenge = auth_ntlmssp_may_set_challenge;
(*auth_ntlmssp_state)->ntlmssp_state->set_challenge = auth_ntlmssp_set_challenge;
(*auth_ntlmssp_state)->ntlmssp_state->check_password = auth_ntlmssp_check_password;
- if ((enum server_types)lp_server_role() == ROLE_STANDALONE) {
- (*auth_ntlmssp_state)->ntlmssp_state->server.is_standalone = true;
- } else {
- (*auth_ntlmssp_state)->ntlmssp_state->server.is_standalone = false;
- }
return NT_STATUS_OK;
}