1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-11 08:23:49 +03:00

1) when no domain used in ntlogin test command, should use default one

from previous lsaquery command.  over-ridden from DOMAIN\username

2) initialisation of cli_state is a little more specific: sets use_ntlmv2
   to Auto.  this can always be over-ridden.

3) fixed reusage of ntlmssp_cli_flgs which was being a pain

4) added pwd_compare() function then fixed bug in cli_use where NULL
   domain name was making connections multiply unfruitfully

5) type-casting of mallocs and Reallocs that cause ansi-c compilers to bitch
This commit is contained in:
Luke Leighton
-
parent e4d92ff9df
commit 301a6efaf6
7 changed files with 142 additions and 38 deletions

View File

@@ -113,29 +113,49 @@ static struct cli_use *cli_find(const char* srv_name,
sv_name = &sv_name[2];
}
DEBUG(10,("cli_find: %s %s %s\n",
srv_name,
usr_creds->user_name,
usr_creds->domain));
for (i = 0; i < num_clis; i++)
{
uchar ntpw[16], clintpw[16];
char *cli_name = NULL;
struct cli_use *c = clis[i];
if (clis[i] == NULL) continue;
if (c == NULL) continue;
cli_name = clis[i]->cli->desthost;
cli_name = c->cli->desthost;
DEBUG(10,("cli_find[%d]: %s %s %s\n",
i, cli_name,
c->cli->usr.user_name,
c->cli->usr.domain));
if (strnequal("\\\\", cli_name, 2))
{
cli_name = &cli_name[2];
}
if (!strequal(cli_name, sv_name)) continue;
pwd_get_lm_nt_16(&usr_creds->pwd, NULL, ntpw);
pwd_get_lm_nt_16(&clis[i]->cli->usr.pwd, NULL, clintpw);
if (strequal(usr_creds->user_name, clis[i]->cli->usr.user_name) &&
strequal(usr_creds->domain, clis[i]->cli->usr.domain) &&
memcmp(ntpw, clintpw, 16) == 0)
if (!strequal(cli_name, sv_name))
{
return clis[i];
continue;
}
if (!strequal(usr_creds->user_name, c->cli->usr.user_name))
{
continue;
}
if (!pwd_compare(&usr_creds->pwd, &c->cli->usr.pwd))
{
continue;
}
if (usr_creds->domain[0] == 0)
{
return c;
}
if (strequal(usr_creds->domain, c->cli->usr.domain))
{
return c;
}
}
@@ -164,11 +184,8 @@ static struct cli_use *cli_use_get(const char* srv_name,
return NULL;
}
cli->cli->capabilities |= CAP_NT_SMBS | CAP_STATUS32;
cli_init_creds(cli->cli, usr_creds);
cli->cli->use_ntlmv2 = lp_client_ntlmv2();
return cli;
}