summaryrefslogtreecommitdiff
path: root/source3/rpc_client
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1998-10-15 23:51:07 +0000
committerLuke Leighton <lkcl@samba.org>1998-10-15 23:51:07 +0000
commitc404bb775414139a4b07a73f79cf069a083acb26 (patch)
tree259eeef5e467083c0b7b29bec846bab90c522bf7 /source3/rpc_client
parent0d5ff90bffe1a5d2bf03412ef0bd12996cbc2f09 (diff)
downloadsamba-c404bb775414139a4b07a73f79cf069a083acb26.tar.gz
samba-c404bb775414139a4b07a73f79cf069a083acb26.tar.bz2
samba-c404bb775414139a4b07a73f79cf069a083acb26.zip
rpcclient interactive login (with trust account changing if you are root)
cli_session_setup handles null sessions correctly (This used to be commit 60c0f22a4e84703467006dfe1971384a6294a9aa)
Diffstat (limited to 'source3/rpc_client')
-rw-r--r--source3/rpc_client/cli_login.c6
-rw-r--r--source3/rpc_client/cli_lsarpc.c4
-rw-r--r--source3/rpc_client/cli_netlogon.c11
3 files changed, 11 insertions, 10 deletions
diff --git a/source3/rpc_client/cli_login.c b/source3/rpc_client/cli_login.c
index abe471379b..1b12828550 100644
--- a/source3/rpc_client/cli_login.c
+++ b/source3/rpc_client/cli_login.c
@@ -83,7 +83,7 @@ BOOL cli_nt_srv_pwset(struct cli_state *cli, unsigned char *new_hashof_mach_pwd)
{
unsigned char processed_new_pwd[16];
- DEBUG(5,("cli_nt_login_interactive: %d\n", __LINE__));
+ DEBUG(5,("cli_nt_srv_pwset: %d\n", __LINE__));
#ifdef DEBUG_PASSWORD
dump_data(6, new_hashof_mach_pwd, 16);
@@ -96,7 +96,6 @@ BOOL cli_nt_srv_pwset(struct cli_state *cli, unsigned char *new_hashof_mach_pwd)
return cli_net_srv_pwset(cli, processed_new_pwd);
}
-#if UNUSED_CODE
/****************************************************************************
NT login - interactive.
*NEVER* use this code. This method of doing a logon (sending the cleartext
@@ -149,7 +148,6 @@ BOOL cli_nt_login_interactive(struct cli_state *cli, char *domain, char *usernam
return ret;
}
-#endif
/****************************************************************************
NT login - network.
@@ -177,7 +175,6 @@ BOOL cli_nt_login_network(struct cli_state *cli, char *domain, char *username,
return cli_net_sam_logon(cli, ctr, user_info3);
}
-#if UNUSED_CODE
/****************************************************************************
NT Logoff.
****************************************************************************/
@@ -188,4 +185,3 @@ BOOL cli_nt_logoff(struct cli_state *cli, NET_ID_INFO_CTR *ctr)
/* Send client sam-logoff request - update credentials on success. */
return cli_net_sam_logoff(cli, ctr);
}
-#endif
diff --git a/source3/rpc_client/cli_lsarpc.c b/source3/rpc_client/cli_lsarpc.c
index d010ae4e29..c280929417 100644
--- a/source3/rpc_client/cli_lsarpc.c
+++ b/source3/rpc_client/cli_lsarpc.c
@@ -58,11 +58,11 @@ BOOL do_lsa_open_policy(struct cli_state *cli,
if (sec_qos)
{
make_lsa_sec_qos(&qos, 2, 1, 0, 0x20000000);
- make_q_open_pol(&q_o, server_name, 0, 0, &qos);
+ make_q_open_pol(&q_o, 0x5c, 0, 0, &qos);
}
else
{
- make_q_open_pol(&q_o, server_name, 0, 0x1, NULL);
+ make_q_open_pol(&q_o, 0x5c, 0, 0x1, NULL);
}
/* turn parameters into data stream */
diff --git a/source3/rpc_client/cli_netlogon.c b/source3/rpc_client/cli_netlogon.c
index 2671bac773..9c81b73692 100644
--- a/source3/rpc_client/cli_netlogon.c
+++ b/source3/rpc_client/cli_netlogon.c
@@ -391,7 +391,6 @@ password ?).\n", cli->desthost ));
return ok;
}
-#if UNUSED_CODE
/***************************************************************************
LSA SAM Logoff.
@@ -465,7 +464,6 @@ password ?).\n", cli->desthost ));
return ok;
}
-#endif
/*********************************************************
Change the domain password on the PDC.
@@ -605,6 +603,7 @@ BOOL change_trust_account_password( char *domain, char *remote_machine_list)
unsigned char old_trust_passwd_hash[16];
unsigned char new_trust_passwd_hash[16];
time_t lct;
+ BOOL res;
if(!get_trust_account_password( old_trust_passwd_hash, &lct)) {
DEBUG(0,("change_trust_account_password: unable to read the machine \
@@ -629,10 +628,16 @@ domain %s.\n", timestring(), domain));
* Return the result of trying to write the new password
* back into the trust account file.
*/
- return set_trust_account_password(new_trust_passwd_hash);
+ res = set_trust_account_password(new_trust_passwd_hash);
+ memset(new_trust_passwd_hash, 0, 16);
+ memset(old_trust_passwd_hash, 0, 16);
+ return res;
}
}
+ memset(new_trust_passwd_hash, 0, 16);
+ memset(old_trust_passwd_hash, 0, 16);
+
DEBUG(0,("%s : change_trust_account_password: Failed to change password for \
domain %s.\n", timestring(), domain));
return False;