summaryrefslogtreecommitdiff
path: root/source3/rpc_client/cli_netlogon.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-04-29 19:22:01 +0000
committerJeremy Allison <jra@samba.org>1998-04-29 19:22:01 +0000
commite305c2c9e2e657974d34d1d58a8f9372921fdae2 (patch)
treecf35e6a21e2ba4cdc00539c24cb41b229b55a06b /source3/rpc_client/cli_netlogon.c
parent4eb37c104d3a23ecefcefe9038de5d10515078dd (diff)
downloadsamba-e305c2c9e2e657974d34d1d58a8f9372921fdae2.tar.gz
samba-e305c2c9e2e657974d34d1d58a8f9372921fdae2.tar.bz2
samba-e305c2c9e2e657974d34d1d58a8f9372921fdae2.zip
clientgen.c: Fixed null session setup bug.
password.c: Stopped cli_nt_logout call (we don't have it correct yet). Added Luke object-orientation fix :-). smb.h: Added clnt_name_slash to cli_state. lib/rpc/client/cli_login.c: Changed global_myname to clnt_name_slash where needed. lib/rpc/client/cli_netlogon.c: Fixed debug messages, don't check creds on error. lib/rpc/client/cli_pipe.c: Fixed debug messages, Added Luke object-orientation fix. lib/rpc/parse/parse_misc.c: Fixed STRING2 linearization bug that was adding 1. Jeremy. (This used to be commit c6c22df20196cb7f0ae84b1a1dd202a87adb8d4e)
Diffstat (limited to 'source3/rpc_client/cli_netlogon.c')
-rw-r--r--source3/rpc_client/cli_netlogon.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/source3/rpc_client/cli_netlogon.c b/source3/rpc_client/cli_netlogon.c
index a8aba1c5dc..da74bc6bc6 100644
--- a/source3/rpc_client/cli_netlogon.c
+++ b/source3/rpc_client/cli_netlogon.c
@@ -50,6 +50,7 @@ static void gen_next_creds( struct cli_state *cli, DOM_CRED *new_clnt_cred)
/* Calculate the new credentials. */
cred_create(cli->sess_key, &(cli->clnt_cred.challenge),
new_clnt_cred->timestamp, &(new_clnt_cred->challenge));
+
}
/****************************************************************************
@@ -285,13 +286,13 @@ BOOL cli_net_srv_pwset(struct cli_state *cli, uint8 hashed_mach_pwd[16])
if (ok && r_s.status != 0)
{
/* report error code */
- DEBUG(0,("NET_R_SRV_PWSET: %s\n", get_nt_error_msg(r_s.status)));
+ DEBUG(0,("cli_net_srv_pwset: %s\n", get_nt_error_msg(r_s.status)));
cli->nt_error = r_s.status;
ok = False;
}
/* Update the credentials. */
- if (clnt_deal_with_creds(cli->sess_key, &(cli->clnt_cred), &(r_s.srv_cred)) == 0)
+ if (ok && !clnt_deal_with_creds(cli->sess_key, &(cli->clnt_cred), &(r_s.srv_cred)))
{
/*
* Server replied with bad credential. Fail.
@@ -316,6 +317,7 @@ BOOL cli_net_sam_logon(struct cli_state *cli, NET_ID_INFO_CTR *ctr,
NET_USER_INFO_3 *user_info3)
{
DOM_CRED new_clnt_cred;
+ DOM_CRED dummy_rtn_creds;
prs_struct rbuf;
prs_struct buf;
uint16 validation_level = 3;
@@ -334,9 +336,11 @@ BOOL cli_net_sam_logon(struct cli_state *cli, NET_ID_INFO_CTR *ctr,
credstr(new_clnt_cred.challenge.data), cli->clnt_cred.timestamp.time,
ctr->switch_value));
+ memset(&dummy_rtn_creds, '\0', sizeof(dummy_rtn_creds));
+
/* store the parameters */
make_sam_info(&(q_s.sam_id), cli->srv_name_slash, global_myname,
- &new_clnt_cred, NULL, ctr->switch_value, ctr, validation_level);
+ &new_clnt_cred, &dummy_rtn_creds, ctr->switch_value, ctr, validation_level);
/* turn parameters into data stream */
net_io_q_sam_logon("", &q_s, &buf, 0);
@@ -360,7 +364,7 @@ BOOL cli_net_sam_logon(struct cli_state *cli, NET_ID_INFO_CTR *ctr,
}
/* Update the credentials. */
- if (clnt_deal_with_creds(cli->sess_key, &(cli->clnt_cred), &(r_s.srv_creds)) == 0)
+ if (ok && !clnt_deal_with_creds(cli->sess_key, &(cli->clnt_cred), &(r_s.srv_creds)))
{
/*
* Server replied with bad credential. Fail.
@@ -387,11 +391,18 @@ password ?).\n", cli->desthost ));
/***************************************************************************
LSA SAM Logoff.
+
+This currently doesnt work correctly as the domain controller
+returns NT_STATUS_INVALID_INFO_CLASS - we obviously need to
+send a different info level. Right now though, I'm not sure
+what that needs to be (I need to see one on the wire before
+I can be sure). JRA.
****************************************************************************/
BOOL cli_net_sam_logoff(struct cli_state *cli, NET_ID_INFO_CTR *ctr)
{
DOM_CRED new_clnt_cred;
+ DOM_CRED dummy_rtn_creds;
prs_struct rbuf;
prs_struct buf;
NET_Q_SAM_LOGOFF q_s;
@@ -410,9 +421,11 @@ BOOL cli_net_sam_logoff(struct cli_state *cli, NET_ID_INFO_CTR *ctr)
credstr(new_clnt_cred.challenge.data), new_clnt_cred.timestamp.time,
ctr->switch_value));
+ memset(&dummy_rtn_creds, '\0', sizeof(dummy_rtn_creds));
+
/* store the parameters */
make_sam_info(&(q_s.sam_id), cli->srv_name_slash, global_myname,
- &new_clnt_cred, NULL, ctr->switch_value, ctr, validation_level);
+ &new_clnt_cred, &dummy_rtn_creds, ctr->switch_value, ctr, validation_level);
/* turn parameters into data stream */
net_io_q_sam_logoff("", &q_s, &buf, 0);
@@ -434,7 +447,7 @@ BOOL cli_net_sam_logoff(struct cli_state *cli, NET_ID_INFO_CTR *ctr)
}
/* Update the credentials. */
- if (clnt_deal_with_creds(cli->sess_key, &(cli->clnt_cred), &(r_s.srv_creds)) == 0)
+ if (ok && !clnt_deal_with_creds(cli->sess_key, &(cli->clnt_cred), &(r_s.srv_creds)))
{
/*
* Server replied with bad credential. Fail.