diff options
author | Luke Leighton <lkcl@samba.org> | 1999-12-01 16:39:51 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1999-12-01 16:39:51 +0000 |
commit | 106fe88be01f7ac7d1369e97a6468dcd80c0a813 (patch) | |
tree | 6e6fc4c4da5fbc96d353cada70119a2a703acc9e /source3/rpcclient/cmd_netlogon.c | |
parent | 6ddfc68e0496dc41f8c9a022a0b04a2066b43c9d (diff) | |
download | samba-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/rpcclient/cmd_netlogon.c')
-rw-r--r-- | source3/rpcclient/cmd_netlogon.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/source3/rpcclient/cmd_netlogon.c b/source3/rpcclient/cmd_netlogon.c index 0b0292e632..89e52ed779 100644 --- a/source3/rpcclient/cmd_netlogon.c +++ b/source3/rpcclient/cmd_netlogon.c @@ -53,12 +53,20 @@ void cmd_netlogon_login_test(struct client_info *info, int argc, char *argv[]) char *nt_password; unsigned char trust_passwd[16]; fstring trust_acct; + fstring domain; + char *p; fstring srv_name; fstrcpy(srv_name, "\\\\"); fstrcat(srv_name, info->dest_host); strupper(srv_name); + fstrcpy(domain, usr_creds->domain); + + if (domain[0] == 0) + { + fstrcpy(domain, info->dom.level3_dom); + } #if 0 /* machine account passwords */ pstring new_mach_pwd; @@ -76,6 +84,7 @@ void cmd_netlogon_login_test(struct client_info *info, int argc, char *argv[]) if (nt_user_name[0] == 0) { report(out_hnd,"ntlogin: must specify username with anonymous connection\n"); + report(out_hnd,"ntlogin [[DOMAIN\\]user] [password]\n"); return; } } @@ -84,6 +93,24 @@ void cmd_netlogon_login_test(struct client_info *info, int argc, char *argv[]) fstrcpy(nt_user_name, argv[0]); } + p = strchr(nt_user_name, '\\'); + if (p != NULL) + { + fstrcpy(domain, nt_user_name); + p = strchr(domain, '\\'); + if (p != NULL) + { + *p = 0; + fstrcpy(nt_user_name, p+1); + } + + } + + if (domain[0] == 0) + { + report(out_hnd,"no domain specified.\n"); + } + argc--; argv++; @@ -102,7 +129,7 @@ void cmd_netlogon_login_test(struct client_info *info, int argc, char *argv[]) fstrcpy(trust_acct, info->myhostname); fstrcat(trust_acct, "$"); - res = res ? trust_get_passwd(trust_passwd, usr_creds->domain, info->myhostname) : False; + res = res ? trust_get_passwd(trust_passwd, domain, info->myhostname) : False; #if 0 /* check whether the user wants to change their machine password */ |