****************************************************************************/
void cmd_netlogon_login_test(struct client_info *info)
{
- uint16 nt_pipe_fnum;
extern BOOL global_machine_password_needs_changing;
fstring nt_user_name;
info->mach_acct, new_mach_pwd) : False;
#endif
/* open NETLOGON session. negotiate credentials */
- res = res ? cli_nt_session_open(smb_cli, PIPE_NETLOGON, &nt_pipe_fnum) : False;
+ res = res ? cli_nt_session_open(smb_cli, PIPE_NETLOGON) : False;
- res = res ? cli_nt_setup_creds(smb_cli, nt_pipe_fnum,
- smb_cli->mach_acct,
- trust_passwd, SEC_CHAN_WKSTA) : False;
+ res = res ? cli_nt_setup_creds(smb_cli, trust_passwd) : False;
/* change the machine password? */
if (global_machine_password_needs_changing)
{
unsigned char new_trust_passwd[16];
generate_random_buffer(new_trust_passwd, 16, True);
- res = res ? cli_nt_srv_pwset(smb_cli, nt_pipe_fnum, new_trust_passwd, SEC_CHAN_WKSTA) : False;
+ res = res ? cli_nt_srv_pwset(smb_cli, new_trust_passwd) : False;
if (res)
{
memset(trust_passwd, 0, 16);
/* do an NT login */
- res = res ? cli_nt_login_interactive(smb_cli, nt_pipe_fnum,
+ res = res ? cli_nt_login_interactive(smb_cli,
smb_cli->domain, nt_user_name,
getuid(), nt_password,
&info->dom.ctr, &info->dom.user_info3) : False;
/* ok! you're logged in! do anything you like, then... */
/* do an NT logout */
- res = res ? cli_nt_logoff(smb_cli, nt_pipe_fnum, &info->dom.ctr) : False;
+ res = res ? cli_nt_logoff(smb_cli, &info->dom.ctr) : False;
/* close the session */
- cli_nt_session_close(smb_cli, nt_pipe_fnum);
+ cli_nt_session_close(smb_cli);
fprintf(out_hnd,"cmd_nt_login: login (%s) test succeeded: %s\n",
nt_user_name, BOOLSTR(res));
}
-/****************************************************************************
-experimental nt login.
-****************************************************************************/
-void cmd_netlogon_domain_test(struct client_info *info)
-{
- uint16 nt_pipe_fnum;
-
- fstring nt_trust_dom;
- BOOL res = True;
- unsigned char trust_passwd[16];
- fstring inter_dom_acct;
-
- if (!next_token(NULL, nt_trust_dom, NULL, sizeof(nt_trust_dom)))
- {
- fprintf(out_hnd,"domtest: must specify domain name\n");
- return;
- }
-
- DEBUG(5,("do_nt_login_test: domain %s\n", nt_trust_dom));
-
- fstrcpy(inter_dom_acct, nt_trust_dom);
- fstrcat(inter_dom_acct, "$");
-
- res = res ? trust_get_passwd(trust_passwd, smb_cli->domain, nt_trust_dom) : False;
-
- /* open NETLOGON session. negotiate credentials */
- res = res ? cli_nt_session_open(smb_cli, PIPE_NETLOGON, &nt_pipe_fnum) : False;
-
- res = res ? cli_nt_setup_creds(smb_cli, nt_pipe_fnum, inter_dom_acct,
- trust_passwd, SEC_CHAN_DOMAIN) : False;
-
- memset(trust_passwd, 0, 16);
-
- /* close the session */
- cli_nt_session_close(smb_cli, nt_pipe_fnum);
-
- fprintf(out_hnd,"cmd_nt_login: credentials (%s) test succeeded: %s\n",
- nt_trust_dom, BOOLSTR(res));
-}
-
-/****************************************************************************
-experimental SAM synchronisation.
-****************************************************************************/
-void cmd_sam_sync(struct client_info *info)
-{
- uint16 nt_pipe_fnum;
- BOOL res = True;
- unsigned char trust_passwd[16];
-
- DEBUG(5,("Attempting SAM Synchronisation with PDC\n"));
-
- res = res ? trust_get_passwd(trust_passwd, smb_cli->domain, info->myhostname) : False;
-
- /* open NETLOGON session. negotiate credentials */
- res = res ? cli_nt_session_open(smb_cli, PIPE_NETLOGON, &nt_pipe_fnum) : False;
-
- res = res ? cli_nt_setup_creds(smb_cli, nt_pipe_fnum, smb_cli->mach_acct,
- trust_passwd, SEC_CHAN_BDC) : False;
-
- res = res ? cli_net_sam_sync(smb_cli, nt_pipe_fnum, 0) : False;
-
- memset(trust_passwd, 0, 16);
-
- /* close the session */
- cli_nt_session_close(smb_cli, nt_pipe_fnum);
-
- fprintf(out_hnd,"cmd_sam_sync: test succeeded: %s\n", BOOLSTR(res));
-}