summaryrefslogtreecommitdiff
path: root/source3/rpc_client/cli_netlogon.c
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1998-09-25 21:01:52 +0000
committerLuke Leighton <lkcl@samba.org>1998-09-25 21:01:52 +0000
commit66d5d73a5d75e88a77970f7b27687b8354ab2e80 (patch)
treeda1b7278847138fc219398238f7a895a1c7f7a82 /source3/rpc_client/cli_netlogon.c
parent1631d3fba7b887a5de23241b39430ffb5e036803 (diff)
downloadsamba-66d5d73a5d75e88a77970f7b27687b8354ab2e80.tar.gz
samba-66d5d73a5d75e88a77970f7b27687b8354ab2e80.tar.bz2
samba-66d5d73a5d75e88a77970f7b27687b8354ab2e80.zip
added rpcclient program
(This used to be commit aa38f39d67fade4dfd7badb7a9b39c833a1dd1ca)
Diffstat (limited to 'source3/rpc_client/cli_netlogon.c')
-rw-r--r--source3/rpc_client/cli_netlogon.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/source3/rpc_client/cli_netlogon.c b/source3/rpc_client/cli_netlogon.c
index 757c5166e8..9af2a05f27 100644
--- a/source3/rpc_client/cli_netlogon.c
+++ b/source3/rpc_client/cli_netlogon.c
@@ -30,6 +30,7 @@
#include "includes.h"
extern int DEBUGLEVEL;
+extern pstring scope;
extern pstring global_myname;
extern fstring global_myworkgroup;
@@ -474,8 +475,8 @@ static BOOL modify_trust_password( char *domain, char *remote_machine,
unsigned char orig_trust_passwd_hash[16],
unsigned char new_trust_passwd_hash[16])
{
- struct in_addr dest_ip;
struct cli_state cli;
+ struct nmb_name calling, called;
ZERO_STRUCT(cli);
if(cli_initialise(&cli) == False) {
@@ -483,24 +484,29 @@ static BOOL modify_trust_password( char *domain, char *remote_machine,
return False;
}
- if(!resolve_name( remote_machine, &dest_ip)) {
+ if(!resolve_name( remote_machine, &cli.dest_ip)) {
DEBUG(0,("modify_trust_password: Can't resolve address for %s\n", remote_machine));
return False;
}
- if (ismyip(dest_ip)) {
+ if (ismyip(cli.dest_ip)) {
DEBUG(0,("modify_trust_password: Machine %s is one of our addresses. Cannot add \
to ourselves.\n", remote_machine));
return False;
}
- if (!cli_connect(&cli, remote_machine, &dest_ip)) {
+ if (!cli_connect(&cli, remote_machine, &cli.dest_ip)) {
DEBUG(0,("modify_trust_password: unable to connect to SMB server on \
machine %s. Error was : %s.\n", remote_machine, cli_errstr(&cli) ));
return False;
}
- if (!cli_session_request(&cli, remote_machine, 0x20, global_myname)) {
+
+ make_nmb_name(&calling, global_myname , 0x0 , scope);
+ make_nmb_name(&called , remote_machine, 0x20, scope);
+
+ if (!cli_session_request(&cli, &calling, &called))
+ {
DEBUG(0,("modify_trust_password: machine %s rejected the session setup. \
Error was : %s.\n", remote_machine, cli_errstr(&cli) ));
cli_shutdown(&cli);