From 94bbd5c93a777ad1a6b3951358306e29e6277251 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 10 Aug 2003 20:18:05 +0000 Subject: Store the server domain from the ntlmssp challenge in the client struct to be able to ask a LMB for the servers in its workgroup. Against W2k this only works on port 139.... Volker (This used to be commit 62b04d7776852098dd768268500f36c3a362f688) --- source3/include/ntlmssp.h | 1 + source3/libsmb/cliconnect.c | 1 + source3/libsmb/ntlmssp.c | 3 +++ 3 files changed, 5 insertions(+) diff --git a/source3/include/ntlmssp.h b/source3/include/ntlmssp.h index 562e4853cc..f1b1bc25e4 100644 --- a/source3/include/ntlmssp.h +++ b/source3/include/ntlmssp.h @@ -100,6 +100,7 @@ typedef struct ntlmssp_client_state char *domain; char *workstation; char *password; + char *server_domain; const char *(*get_global_myname)(void); const char *(*get_domain)(void); diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c index 94fe04a480..a1a207d197 100644 --- a/source3/libsmb/cliconnect.c +++ b/source3/libsmb/cliconnect.c @@ -610,6 +610,7 @@ static BOOL cli_session_setup_ntlmssp(struct cli_state *cli, const char *user, } while (NT_STATUS_EQUAL(nt_status, NT_STATUS_MORE_PROCESSING_REQUIRED)); if (NT_STATUS_IS_OK(nt_status)) { + fstrcpy(cli->server_domain, ntlmssp_state->server_domain); set_cli_session_key(cli, ntlmssp_state->session_key); } diff --git a/source3/libsmb/ntlmssp.c b/source3/libsmb/ntlmssp.c index a50ae9b70f..e76ad75e6e 100644 --- a/source3/libsmb/ntlmssp.c +++ b/source3/libsmb/ntlmssp.c @@ -529,6 +529,9 @@ static NTSTATUS ntlmssp_client_challenge(struct ntlmssp_client_state *ntlmssp_st return NT_STATUS_INVALID_PARAMETER; } + ntlmssp_state->server_domain = talloc_strdup(ntlmssp_state->mem_ctx, + server_domain); + SAFE_FREE(server_domain); if (challenge_blob.length != 8) { data_blob_free(&struct_blob); -- cgit