summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/client/client.c13
-rw-r--r--source3/libsmb/cliconnect.c9
2 files changed, 9 insertions, 13 deletions
diff --git a/source3/client/client.c b/source3/client/client.c
index a5654a0eaf..bf0e0f6b04 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -2162,17 +2162,12 @@ struct cli_state *do_connect(const char *server, const char *share)
d_printf("Anonymous login successful\n");
}
- /*
- * These next two lines are needed to emulate
- * old client behaviour for people who have
- * scripts based on client output.
- * QUESTION ? Do we want to have a 'client compatibility
- * mode to turn these on/off ? JRA.
- */
-
- if (*c->server_domain || *c->server_os || *c->server_type){
+ if (*c->server_domain) {
DEBUG(1,("Domain=[%s] OS=[%s] Server=[%s]\n",
c->server_domain,c->server_os,c->server_type));
+ } else if (*c->server_os || *c->server_type){
+ DEBUG(1,("OS=[%s] Server=[%s]\n",
+ c->server_os,c->server_type));
}
DEBUG(4,(" session setup ok\n"));
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index d636e7e839..75560da676 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/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;
}