a quick fix to get rpcclient working again. This just disables
authorAndrew Tridgell <tridge@samba.org>
Mon, 22 Oct 2001 06:48:35 +0000 (06:48 +0000)
committerAndrew Tridgell <tridge@samba.org>
Mon, 22 Oct 2001 06:48:35 +0000 (06:48 +0000)
NTLMSSP in cli_establish_connection()

What we really need to do is kill off the pwd_cache code. It is horrible,
and assumes the challenge comes in the negprot reply.

source/include/client.h
source/lib/util.c
source/libsmb/cliconnect.c
source/libsmb/clientgen.c

index 22ea10b9a785f3438095a4413a77157fdd316fd8..46c8254b0932e5d7be60b915d91e24d1fd824739 100644 (file)
@@ -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? */
index 90bb462d0eea167dd46ce8b2a7cbf9985e45c49a..61da9eb230697f0753a61992aa9679e199f4227c 100644 (file)
@@ -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;
        }
index dc8c7c295737e67aa495f70d8b107f5dbd9d6420..2dad0247b2ae5ee2e0f04c1f7d1092bde08f286d 100644 (file)
@@ -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))
index ed0bc6481e784688690deee224361a51d7399413..ec8d2e2bfc90942c5eb0e7dcfdd8704555ea142f 100644 (file)
@@ -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;