summaryrefslogtreecommitdiff
path: root/source3/rpc_client/cli_netlogon.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2001-12-05 11:00:26 +0000
committerAndrew Bartlett <abartlet@samba.org>2001-12-05 11:00:26 +0000
commit8ba00d147bbdb705b411e182433632c81a036188 (patch)
treeebbeb3b46c5cb3a2da025a324b1cc31f8af182ac /source3/rpc_client/cli_netlogon.c
parent0d09562eed608941b2bee29e37d7ea4ba33582c3 (diff)
downloadsamba-8ba00d147bbdb705b411e182433632c81a036188.tar.gz
samba-8ba00d147bbdb705b411e182433632c81a036188.tar.bz2
samba-8ba00d147bbdb705b411e182433632c81a036188.zip
OK. Smbpasswd -j is DEAD.
This moves the rest of the functionality into the 'net rpc join' code. Futhermore, this moves that entire area over to the libsmb codebase, rather than the crufty old rpc_client stuff. I have also fixed up the smbpasswd -a -m bug in the process. We also have a new 'net rpc changetrustpw' that can be called from a cron-job to regularly change the trust account password, for sites that run winbind but not smbd. With a little more work, we can kill rpc_client from smbd entirly! (It is mostly the domain auth stuff - which I can rework - and the spoolss stuff that sombody else will need to look over). Andrew Bartlett (This used to be commit 575897e879fc175ba702adf245384033342c903d)
Diffstat (limited to 'source3/rpc_client/cli_netlogon.c')
-rw-r--r--source3/rpc_client/cli_netlogon.c70
1 files changed, 0 insertions, 70 deletions
diff --git a/source3/rpc_client/cli_netlogon.c b/source3/rpc_client/cli_netlogon.c
index 869de91c80..8a2d8e28cc 100644
--- a/source3/rpc_client/cli_netlogon.c
+++ b/source3/rpc_client/cli_netlogon.c
@@ -260,76 +260,6 @@ BOOL cli_net_req_chal(struct cli_state *cli, DOM_CHAL *clnt_chal, DOM_CHAL *srv_
return valid_chal;
}
-
-/***************************************************************************
-LSA Server Password Set.
-****************************************************************************/
-
-BOOL cli_net_srv_pwset(struct cli_state *cli, uint8 hashed_mach_pwd[16])
-{
- prs_struct rbuf;
- prs_struct buf;
- DOM_CRED new_clnt_cred;
- NET_Q_SRV_PWSET q_s;
- BOOL ok = False;
- uint16 sec_chan_type = 2;
-
- gen_next_creds( cli, &new_clnt_cred);
-
- prs_init(&buf , 1024, cli->mem_ctx, MARSHALL);
- prs_init(&rbuf, 0, cli->mem_ctx, UNMARSHALL);
-
- /* create and send a MSRPC command with api NET_SRV_PWSET */
-
- DEBUG(4,("cli_net_srv_pwset: srv:%s acct:%s sc: %d mc: %s clnt %s %x\n",
- cli->srv_name_slash, cli->mach_acct, sec_chan_type, global_myname,
- credstr(new_clnt_cred.challenge.data), new_clnt_cred.timestamp.time));
-
- /* store the parameters */
- init_q_srv_pwset(&q_s, cli->srv_name_slash,
- cli->mach_acct, sec_chan_type, global_myname,
- &new_clnt_cred, (char *)hashed_mach_pwd);
-
- /* turn parameters into data stream */
- if(!net_io_q_srv_pwset("", &q_s, &buf, 0)) {
- DEBUG(0,("cli_net_srv_pwset: Error : failed to marshall NET_Q_SRV_PWSET struct.\n"));
- prs_mem_free(&buf);
- prs_mem_free(&rbuf);
- return False;
- }
-
- /* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, NET_SRVPWSET, &buf, &rbuf))
- {
- NET_R_SRV_PWSET r_s;
-
- ok = net_io_r_srv_pwset("", &r_s, &rbuf, 0);
-
- if (ok && !NT_STATUS_IS_OK(r_s.status))
- {
- /* report error code */
- DEBUG(0,("cli_net_srv_pwset: %s\n", get_nt_error_msg(r_s.status)));
- ok = False;
- }
-
- /* Update the credentials. */
- if (ok && !clnt_deal_with_creds(cli->sess_key, &(cli->clnt_cred), &(r_s.srv_cred)))
- {
- /*
- * Server replied with bad credential. Fail.
- */
- DEBUG(0,("cli_net_srv_pwset: server %s replied with bad credential (bad machine \
-password ?).\n", cli->desthost ));
- ok = False;
- }
- }
-
- prs_mem_free(&buf);
- prs_mem_free(&rbuf);
-
- return ok;
-}
-
/***************************************************************************
LSA SAM Logon internal - interactive or network. Does level 2 or 3 but always
returns level 3.