summaryrefslogtreecommitdiff
path: root/source3/rpcclient/cmd_netlogon.c
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-09-21 21:28:27 +0000
committerLuke Leighton <lkcl@samba.org>1999-09-21 21:28:27 +0000
commitf1c2fdb2704e04b05fe3247c53162006a25e75fb (patch)
tree5fd57a19131e860fe6d9340943b3725b4da95839 /source3/rpcclient/cmd_netlogon.c
parent0a6eac0b79dd818ca747423c228eca876faf10af (diff)
downloadsamba-f1c2fdb2704e04b05fe3247c53162006a25e75fb.tar.gz
samba-f1c2fdb2704e04b05fe3247c53162006a25e75fb.tar.bz2
samba-f1c2fdb2704e04b05fe3247c53162006a25e75fb.zip
split matthew's sync command (only currently called from smbpasswd)
into a separate module (This used to be commit d99eca020a255022dbc71f3671127343d75db59e)
Diffstat (limited to 'source3/rpcclient/cmd_netlogon.c')
-rw-r--r--source3/rpcclient/cmd_netlogon.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/source3/rpcclient/cmd_netlogon.c b/source3/rpcclient/cmd_netlogon.c
index 1d99b99f9c..f536a0f52f 100644
--- a/source3/rpcclient/cmd_netlogon.c
+++ b/source3/rpcclient/cmd_netlogon.c
@@ -65,7 +65,7 @@ void cmd_netlogon_login_test(struct client_info *info)
fstrcpy(nt_user_name, smb_cli->user_name);
if (nt_user_name[0] == 0)
{
- fprintf(out_hnd,"ntlogin: must specify username with anonymous connection\n");
+ report(out_hnd,"ntlogin: must specify username with anonymous connection\n");
return;
}
}
@@ -130,7 +130,7 @@ void cmd_netlogon_login_test(struct client_info *info)
/* close the session */
cli_nt_session_close(smb_cli, nt_pipe_fnum);
- fprintf(out_hnd,"cmd_nt_login: login (%s) test succeeded: %s\n",
+ report(out_hnd,"cmd_nt_login: login (%s) test succeeded: %s\n",
nt_user_name, BOOLSTR(res));
}
@@ -148,7 +148,7 @@ void cmd_netlogon_domain_test(struct client_info *info)
if (!next_token(NULL, nt_trust_dom, NULL, sizeof(nt_trust_dom)))
{
- fprintf(out_hnd,"domtest: must specify domain name\n");
+ report(out_hnd,"domtest: must specify domain name\n");
return;
}
@@ -170,7 +170,7 @@ void cmd_netlogon_domain_test(struct client_info *info)
/* close the session */
cli_nt_session_close(smb_cli, nt_pipe_fnum);
- fprintf(out_hnd,"cmd_nt_login: credentials (%s) test succeeded: %s\n",
+ report(out_hnd,"cmd_nt_login: credentials (%s) test succeeded: %s\n",
nt_trust_dom, BOOLSTR(res));
}
@@ -182,8 +182,16 @@ void cmd_sam_sync(struct client_info *info)
SAM_DELTA_HDR hdr_deltas[MAX_SAM_DELTAS];
SAM_DELTA_CTR deltas[MAX_SAM_DELTAS];
uint32 num;
+ uchar trust_passwd[16];
+ extern pstring global_myname;
- if (do_sam_sync(smb_cli, hdr_deltas, deltas, &num))
+ if (!trust_get_passwd(trust_passwd, smb_cli->domain, global_myname))
+ {
+ report(out_hnd, "cmd_sam_sync: no trust account password\n");
+ return;
+ }
+
+ if (do_sam_sync(smb_cli, trust_passwd, hdr_deltas, deltas, &num))
{
display_sam_sync(out_hnd, ACTION_HEADER , hdr_deltas, deltas, num);
display_sam_sync(out_hnd, ACTION_ENUMERATE, hdr_deltas, deltas, num);