first pass at updating head branch to be to be the same as the SAMBA_2_0 branch
[kai/samba.git] / source / rpcclient / cmd_netlogon.c
index be5bf8596a9ff6c24c8db77e481e11ca1ba4e28f..2c8514b43e8def6fbf45b513d35e87033803ab67 100644 (file)
@@ -43,7 +43,6 @@ experimental nt login.
 ****************************************************************************/
 void cmd_netlogon_login_test(struct client_info *info)
 {
-       uint16 nt_pipe_fnum;
        extern BOOL global_machine_password_needs_changing;
 
        fstring nt_user_name;
@@ -90,18 +89,16 @@ void cmd_netlogon_login_test(struct client_info *info)
                                        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)
                {
@@ -114,7 +111,7 @@ void cmd_netlogon_login_test(struct client_info *info)
        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;
@@ -125,80 +122,12 @@ void cmd_netlogon_login_test(struct client_info *info)
        /* 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));
-}