summaryrefslogtreecommitdiffstats
path: root/source/libsmb
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-12-21 12:29:51 +0000
committerAndrew Tridgell <tridge@samba.org>2001-12-21 12:29:51 +0000
commit20368455ea59e6e9b85632848bbe92069e7b0f38 (patch)
tree669ac8d8657674de58035422eacc7aca5c3ed340 /source/libsmb
parent1da988456dbd885820093ae43c74e0ac66f72802 (diff)
downloadsamba-20368455ea59e6e9b85632848bbe92069e7b0f38.tar.gz
samba-20368455ea59e6e9b85632848bbe92069e7b0f38.tar.xz
samba-20368455ea59e6e9b85632848bbe92069e7b0f38.zip
- handle kerberos session setup reply with broken null termination
- don't display Domain=[] for auth protocols that don't give us a domain
Diffstat (limited to 'source/libsmb')
-rw-r--r--source/libsmb/cliconnect.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/libsmb/cliconnect.c b/source/libsmb/cliconnect.c
index d636e7e839e..75560da6766 100644
--- a/source/libsmb/cliconnect.c
+++ b/source/libsmb/cliconnect.c
@@ -325,6 +325,7 @@ static DATA_BLOB cli_session_setup_blob(struct cli_state *cli, DATA_BLOB blob)
uint32 capabilities = cli_session_setup_capabilities(cli);
char *p;
DATA_BLOB blob2;
+ uint32 len;
blob2 = data_blob(NULL, 0);
@@ -371,10 +372,10 @@ static DATA_BLOB cli_session_setup_blob(struct cli_state *cli, DATA_BLOB blob)
p += blob2.length;
p += clistr_pull(cli, cli->server_os, p, sizeof(fstring), -1, STR_TERMINATE);
- p += clistr_pull(cli, cli->server_type, p, sizeof(fstring), -1, STR_TERMINATE);
- p += clistr_pull(cli, cli->server_domain, p, sizeof(fstring),
- smb_buflen(cli->inbuf) - PTR_DIFF(p, smb_buf(cli->inbuf)),
- 0);
+
+ /* w2k with kerberos doesn't properly null terminate this field */
+ len = smb_buflen(cli->inbuf) - PTR_DIFF(p, smb_buf(cli->inbuf));
+ p += clistr_pull(cli, cli->server_type, p, sizeof(fstring), len, 0);
return blob2;
}