#include "includes.h"
-static struct {
+static const struct {
int prot;
const char *name;
}
p = smb_buf(cli->outbuf);
memcpy(p,pword,passlen);
p += passlen;
- p += clistr_push(cli, p, user, -1, STR_UPPER|STR_TERMINATE);
+ p += clistr_push(cli, p, user, -1, STR_TERMINATE);
cli_setup_bcc(cli, p);
cli_send_smb(cli);
int passlen;
char *p;
- passlen = clistr_push(cli, pword, pass, sizeof(pword), STR_TERMINATE);
+ passlen = clistr_push(cli, pword, pass, sizeof(pword), STR_TERMINATE|STR_ASCII);
set_message(cli->outbuf,13,0,True);
CVAL(cli->outbuf,smb_com) = SMBsesssetupX;
CVAL(cli->outbuf,smb_vwv0) = 0xFF;
SSVAL(cli->outbuf,smb_vwv2,CLI_BUFFER_SIZE);
SSVAL(cli->outbuf,smb_vwv3,2);
- SSVAL(cli->outbuf,smb_vwv4,0);
+ SSVAL(cli->outbuf,smb_vwv4,1);
SIVAL(cli->outbuf,smb_vwv5,0);
SSVAL(cli->outbuf,smb_vwv7,blob.length);
SIVAL(cli->outbuf,smb_vwv10,capabilities);
/* we don't need this blob for kerberos */
data_blob_free(&blob2);
+ data_blob_free(&negTokenTarg);
+
return !cli_is_error(cli);
}
#endif
/* encrypt the password with the challenge */
memcpy(challenge, chal1.data + 24, 8);
- SMBencrypt(pass, challenge,lmhash);
- SMBNTencrypt(pass, challenge,nthash);
+ SMBencrypt((unsigned char *)pass, challenge,lmhash);
+ SMBNTencrypt((unsigned char *)pass, challenge,nthash);
#if 0
file_save("nthash.dat", nthash, 24);
return False;
}
- fstrcpy(cli->dev, "A:");
-
- if (cli->protocol >= PROTOCOL_NT1) {
- clistr_pull(cli, cli->dev, smb_buf(cli->inbuf), sizeof(fstring), -1, STR_TERMINATE);
- }
+ clistr_pull(cli, cli->dev, smb_buf(cli->inbuf), sizeof(fstring), -1, STR_TERMINATE|STR_ASCII);
if (strcasecmp(share,"IPC$")==0) {
fstrcpy(cli->dev, "IPC");
}
- /* only grab the device if we have a recent protocol level */
if (cli->protocol >= PROTOCOL_NT1 &&
smb_buflen(cli->inbuf) == 3) {
/* almost certainly win95 - enable bug fixes */
cli->writebraw_supported = True;
}
/* work out if they sent us a workgroup */
- if (smb_buflen(cli->inbuf) > 8) {
+ if (!(cli->capabilities & CAP_EXTENDED_SECURITY) &&
+ smb_buflen(cli->inbuf) > 8) {
clistr_pull(cli, cli->server_domain,
smb_buf(cli->inbuf)+8, sizeof(cli->server_domain),
smb_buflen(cli->inbuf)-8, STR_UNICODE|STR_NOALIGN);
return True;
}
-/****************************************************************************
-re-establishes a connection
-****************************************************************************/
-BOOL cli_reestablish_connection(struct cli_state *cli)
-{
- struct nmb_name calling;
- struct nmb_name called;
- fstring dest_host;
- fstring share;
- fstring dev;
- BOOL do_tcon = False;
- int oldfd = cli->fd;
-
- if (!cli->initialised || cli->fd == -1)
- {
- DEBUG(3,("cli_reestablish_connection: not connected\n"));
- return False;
- }
-
- /* copy the parameters necessary to re-establish the connection */
-
- if (cli->cnum != 0)
- {
- fstrcpy(share, cli->share);
- fstrcpy(dev , cli->dev);
- do_tcon = True;
- }
-
- memcpy(&called , &(cli->called ), sizeof(called ));
- memcpy(&calling, &(cli->calling), sizeof(calling));
- fstrcpy(dest_host, cli->full_dest_host_name);
-
- DEBUG(5,("cli_reestablish_connection: %s connecting to %s (ip %s) - %s [%s]\n",
- nmb_namestr(&calling), nmb_namestr(&called),
- inet_ntoa(cli->dest_ip),
- cli->user_name, cli->domain));
-
- cli->fd = -1;
-
- if (cli_establish_connection(cli,
- dest_host, &cli->dest_ip,
- &calling, &called,
- share, dev, False, do_tcon)) {
- if ((cli->fd != oldfd) && (oldfd != -1)) {
- close( oldfd );
- }
- return True;
- }
- return False;
-}
-
/****************************************************************************
establishes a connection right up to doing tconX, reading in a password.
****************************************************************************/
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))