summaryrefslogtreecommitdiff
path: root/source3/rpc_client/cli_use.c
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-12-01 16:39:51 +0000
committerLuke Leighton <lkcl@samba.org>1999-12-01 16:39:51 +0000
commit106fe88be01f7ac7d1369e97a6468dcd80c0a813 (patch)
tree6e6fc4c4da5fbc96d353cada70119a2a703acc9e /source3/rpc_client/cli_use.c
parent6ddfc68e0496dc41f8c9a022a0b04a2066b43c9d (diff)
downloadsamba-106fe88be01f7ac7d1369e97a6468dcd80c0a813.tar.gz
samba-106fe88be01f7ac7d1369e97a6468dcd80c0a813.tar.bz2
samba-106fe88be01f7ac7d1369e97a6468dcd80c0a813.zip
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 used to be commit 301a6efaf67ddc96e6dcfd21b45a82863ff8f39a)
Diffstat (limited to 'source3/rpc_client/cli_use.c')
-rw-r--r--source3/rpc_client/cli_use.c47
1 files changed, 32 insertions, 15 deletions
diff --git a/source3/rpc_client/cli_use.c b/source3/rpc_client/cli_use.c
index a2559fbaab..a953d332e1 100644
--- a/source3/rpc_client/cli_use.c
+++ b/source3/rpc_client/cli_use.c
@@ -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;
}