summaryrefslogtreecommitdiffstats
path: root/source/rpcclient/cmd_netlogon.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/rpcclient/cmd_netlogon.c')
-rw-r--r--source/rpcclient/cmd_netlogon.c44
1 files changed, 18 insertions, 26 deletions
diff --git a/source/rpcclient/cmd_netlogon.c b/source/rpcclient/cmd_netlogon.c
index 98ba92e5a3f..c9ab4393ba2 100644
--- a/source/rpcclient/cmd_netlogon.c
+++ b/source/rpcclient/cmd_netlogon.c
@@ -82,25 +82,25 @@ static void display_sam_sync(uint32 num_deltas, SAM_DELTA_HDR *hdr_deltas,
for (i = 0; i < num_deltas; i++) {
switch (hdr_deltas[i].type) {
case SAM_DELTA_DOMAIN_INFO:
- unistr2_to_ascii(name,
+ unistr2_to_unix(name,
&deltas[i].domain_info.uni_dom_name,
sizeof(name) - 1);
printf("Domain: %s\n", name);
break;
case SAM_DELTA_GROUP_INFO:
- unistr2_to_ascii(name,
+ unistr2_to_unix(name,
&deltas[i].group_info.uni_grp_name,
sizeof(name) - 1);
printf("Group: %s\n", name);
break;
case SAM_DELTA_ACCOUNT_INFO:
- unistr2_to_ascii(name,
+ unistr2_to_unix(name,
&deltas[i].account_info.uni_acct_name,
sizeof(name) - 1);
printf("Account: %s\n", name);
break;
case SAM_DELTA_ALIAS_INFO:
- unistr2_to_ascii(name,
+ unistr2_to_unix(name,
&deltas[i].alias_info.uni_als_name,
sizeof(name) - 1);
printf("Alias: %s\n", name);
@@ -125,10 +125,11 @@ static void display_sam_sync(uint32 num_deltas, SAM_DELTA_HDR *hdr_deltas,
group->rids[j], group->attribs[j]);
break;
}
- case SAM_DELTA_MODIFIED_COUNT: {
- SAM_DELTA_MOD_COUNT *mc = &deltas[i].mod_count;
+ case SAM_DELTA_SAM_STAMP: {
+ SAM_DELTA_STAMP *stamp = &deltas[i].stamp;
- printf("sam sequence update: 0x%04x\n", mc->seqnum);
+ printf("sam sequence update: 0x%04x\n",
+ stamp->seqnum);
break;
}
default:
@@ -151,7 +152,6 @@ static NTSTATUS cmd_netlogon_sam_sync(struct cli_state *cli,
SAM_DELTA_HDR *hdr_deltas;
SAM_DELTA_CTR *deltas;
DOM_CRED ret_creds;
- uint32 neg_flags = 0x000001ff;
if (argc > 2) {
fprintf(stderr, "Usage: %s [database_id]\n", argv[0]);
@@ -174,7 +174,7 @@ static NTSTATUS cmd_netlogon_sam_sync(struct cli_state *cli,
goto done;
}
- result = cli_nt_setup_creds(cli, get_sec_chan(), trust_passwd, &neg_flags, 2);
+ result = cli_nt_setup_creds(cli, trust_passwd);
if (!NT_STATUS_IS_OK(result)) {
fprintf(stderr, "Error initialising session creds\n");
@@ -187,7 +187,7 @@ static NTSTATUS cmd_netlogon_sam_sync(struct cli_state *cli,
/* Synchronise sam database */
result = cli_netlogon_sam_sync(cli, mem_ctx, &ret_creds, database_id,
- 0, &num_deltas, &hdr_deltas, &deltas);
+ &num_deltas, &hdr_deltas, &deltas);
if (!NT_STATUS_IS_OK(result))
goto done;
@@ -212,7 +212,6 @@ static NTSTATUS cmd_netlogon_sam_deltas(struct cli_state *cli,
SAM_DELTA_HDR *hdr_deltas;
SAM_DELTA_CTR *deltas;
UINT64_S seqnum;
- uint32 neg_flags = 0x000001ff;
if (argc != 3) {
fprintf(stderr, "Usage: %s database_id seqnum\n", argv[0]);
@@ -238,7 +237,7 @@ static NTSTATUS cmd_netlogon_sam_deltas(struct cli_state *cli,
goto done;
}
- result = cli_nt_setup_creds(cli, get_sec_chan(), trust_passwd, &neg_flags, 2);
+ result = cli_nt_setup_creds(cli, trust_passwd);
if (!NT_STATUS_IS_OK(result)) {
fprintf(stderr, "Error initialising session creds\n");
@@ -272,15 +271,12 @@ static NTSTATUS cmd_netlogon_sam_logon(struct cli_state *cli,
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
int logon_type = NET_LOGON_TYPE;
char *username, *password;
- uint32 neg_flags = 0x000001ff;
- int auth_level = 2;
/* Check arguments */
- if (argc < 3 || argc > 6) {
+ if (argc < 3 || argc > 4) {
fprintf(stderr, "Usage: samlogon <username> <password> "
- "[logon_type] [neg flags] [auth level (2 or 3)]\n"
- "neg flags being 0x000001ff or 0x6007ffff\n");
+ "[logon_type]\n");
return NT_STATUS_OK;
}
@@ -290,12 +286,6 @@ static NTSTATUS cmd_netlogon_sam_logon(struct cli_state *cli,
if (argc == 4)
sscanf(argv[3], "%i", &logon_type);
- if (argc == 5)
- sscanf(argv[4], "%i", &neg_flags);
-
- if (argc == 6)
- sscanf(argv[5], "%i", &auth_level);
-
/* Authenticate ourselves with the domain controller */
if (!secrets_init()) {
@@ -303,12 +293,13 @@ static NTSTATUS cmd_netlogon_sam_logon(struct cli_state *cli,
return result;
}
- if (!secrets_fetch_trust_account_password(lp_workgroup(), trust_passwd, NULL)) {
+ if (!secrets_fetch_trust_account_password(lp_workgroup(), trust_passwd,
+ NULL)) {
fprintf(stderr, "could not fetch trust account password\n");
goto done;
}
- result = cli_nt_setup_creds(cli, get_sec_chan(), trust_passwd, &neg_flags, auth_level);
+ result = cli_nt_setup_creds(cli, trust_passwd);
if (!NT_STATUS_IS_OK(result)) {
fprintf(stderr, "Error initialising session creds\n");
@@ -317,7 +308,8 @@ static NTSTATUS cmd_netlogon_sam_logon(struct cli_state *cli,
/* Perform the sam logon */
- result = cli_netlogon_sam_logon(cli, mem_ctx, username, password, logon_type);
+ result = cli_netlogon_sam_logon(cli, mem_ctx, username, password,
+ logon_type);
if (!NT_STATUS_IS_OK(result))
goto done;