auth: Allow the netbios name and domain to be set from winbindd in ntlm_auth3
authorAndrew Bartlett <abartlet@samba.org>
Mon, 6 Feb 2012 07:02:11 +0000 (18:02 +1100)
committerStefan Metzmacher <metze@samba.org>
Fri, 17 Feb 2012 11:18:51 +0000 (12:18 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri Feb 17 12:18:51 CET 2012 on sn-devel-104

auth/gensec/gensec.h
auth/ntlmssp/gensec_ntlmssp_server.c

index aba1018..f88da22 100644 (file)
@@ -87,6 +87,8 @@ struct gensec_settings {
        /* To fill in our own name in the NTLMSSP server */
        const char *server_dns_domain;
        const char *server_dns_name;
+       const char *server_netbios_domain;
+       const char *server_netbios_name;
 };
 
 struct gensec_security_ops {
index 6ba3976..8f45c2c 100644 (file)
@@ -343,8 +343,17 @@ NTSTATUS gensec_ntlmssp_server_start(struct gensec_security *gensec_security)
                ntlmssp_state->server.is_standalone = false;
        }
 
-       netbios_name = lpcfg_netbios_name(gensec_security->settings->lp_ctx);
-       netbios_domain = lpcfg_workgroup(gensec_security->settings->lp_ctx);
+       if (gensec_security->settings->server_netbios_name) {
+               netbios_name = gensec_security->settings->server_netbios_name;
+       } else {
+               netbios_name = lpcfg_netbios_name(gensec_security->settings->lp_ctx);
+       }
+
+       if (gensec_security->settings->server_netbios_domain) {
+               netbios_domain = gensec_security->settings->server_netbios_domain;
+       } else {
+               netbios_domain = lpcfg_workgroup(gensec_security->settings->lp_ctx);
+       }
 
        if (gensec_security->settings->server_dns_name) {
                dns_name = gensec_security->settings->server_dns_name;