diff options
-rw-r--r-- | source3/include/client.h | 1 | ||||
-rw-r--r-- | source3/lib/util.c | 2 | ||||
-rw-r--r-- | source3/libsmb/cliconnect.c | 4 | ||||
-rw-r--r-- | source3/libsmb/clientgen.c | 5 |
4 files changed, 10 insertions, 2 deletions
diff --git a/source3/include/client.h b/source3/include/client.h index 22ea10b9a7..46c8254b09 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -129,6 +129,7 @@ struct cli_state { vuser_key key; uint32 ntlmssp_flags; BOOL use_kerberos; + BOOL use_spnego; BOOL use_oplocks; /* should we use oplocks? */ BOOL use_level_II_oplocks; /* should we use level II oplocks? */ diff --git a/source3/lib/util.c b/source3/lib/util.c index 90bb462d0e..61da9eb230 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -1938,7 +1938,7 @@ DATA_BLOB data_blob(void *p, size_t length) { DATA_BLOB ret; - if (!p) { + if (!p || !length) { ZERO_STRUCT(ret); return ret; } diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c index dc8c7c2957..2dad0247b2 100644 --- a/source3/libsmb/cliconnect.c +++ b/source3/libsmb/cliconnect.c @@ -1087,6 +1087,10 @@ BOOL cli_establish_connection(struct cli_state *cli, return False; } + /* cli_establish_connection() can't handle spnego yet. Once we get rid of + pwd_cache and other horrors we can get rid of this */ + cli->use_spnego = False; + if (cli->fd == -1) { if (!cli_connect(cli, dest_host, dest_ip)) diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c index ed0bc6481e..ec8d2e2bfc 100644 --- a/source3/libsmb/clientgen.c +++ b/source3/libsmb/clientgen.c @@ -112,7 +112,9 @@ void cli_setup_packet(struct cli_state *cli) if (cli->capabilities & CAP_STATUS32) { flags2 |= FLAGS2_32_BIT_ERROR_CODES; } - flags2 |= FLAGS2_EXTENDED_SECURITY; + if (cli->use_spnego) { + flags2 |= FLAGS2_EXTENDED_SECURITY; + } SSVAL(cli->outbuf,smb_flg2, flags2); } } @@ -179,6 +181,7 @@ struct cli_state *cli_initialise(struct cli_state *cli) cli->outbuf = (char *)malloc(cli->bufsize); cli->inbuf = (char *)malloc(cli->bufsize); cli->oplock_handler = cli_oplock_ack; + cli->use_spnego = True; if (!cli->outbuf || !cli->inbuf) goto error; |