summaryrefslogtreecommitdiff
path: root/source3/rpcclient
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-10-21 14:51:13 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-10-21 14:51:13 +0200
commit5209a846a9157e649fcdcb561f7eaf19c8c0e465 (patch)
treeb0a7e52b5646c8eec182dbc391e7934b6804488c /source3/rpcclient
parent625359b2e266105022309df8985720108ecd6f67 (diff)
parent2ee8d29d22bcb1c350ab59d71b0aee548489bc9c (diff)
downloadsamba-5209a846a9157e649fcdcb561f7eaf19c8c0e465.tar.gz
samba-5209a846a9157e649fcdcb561f7eaf19c8c0e465.tar.bz2
samba-5209a846a9157e649fcdcb561f7eaf19c8c0e465.zip
Merge branch 'master' of ssh://git.samba.org/data/git/samba into regsrv
Conflicts: source4/lib/registry/ldb.c source4/rpc_server/winreg/rpc_winreg.c
Diffstat (limited to 'source3/rpcclient')
-rw-r--r--source3/rpcclient/cmd_drsuapi.c19
-rw-r--r--source3/rpcclient/cmd_lsarpc.c11
-rw-r--r--source3/rpcclient/cmd_netlogon.c2
-rw-r--r--source3/rpcclient/cmd_samr.c48
-rw-r--r--source3/rpcclient/cmd_spoolss.c2
5 files changed, 44 insertions, 38 deletions
diff --git a/source3/rpcclient/cmd_drsuapi.c b/source3/rpcclient/cmd_drsuapi.c
index 71757f5ea3..8fbd798ed0 100644
--- a/source3/rpcclient/cmd_drsuapi.c
+++ b/source3/rpcclient/cmd_drsuapi.c
@@ -103,7 +103,7 @@ static WERROR cmd_drsuapi_cracknames(struct rpc_pipe_client *cli,
werr = cracknames(cli, mem_ctx,
&bind_handle,
- DRSUAPI_DS_NAME_FORMAT_UKNOWN,
+ DRSUAPI_DS_NAME_FORMAT_UNKNOWN,
DRSUAPI_DS_NAME_FORMAT_FQDN_1779,
1,
argv+1,
@@ -419,7 +419,7 @@ static WERROR cmd_drsuapi_getncchanges(struct rpc_pipe_client *cli,
werr = cracknames(cli, mem_ctx,
&bind_handle,
- DRSUAPI_DS_NAME_FORMAT_UKNOWN,
+ DRSUAPI_DS_NAME_FORMAT_UNKNOWN,
DRSUAPI_DS_NAME_FORMAT_FQDN_1779,
1,
&name,
@@ -495,9 +495,9 @@ static WERROR cmd_drsuapi_getncchanges(struct rpc_pipe_client *cli,
if (level_out == 1) {
out_level = 1;
ctr1 = &ctr.ctr1;
- } else if (level_out == 2) {
+ } else if (level_out == 2 && ctr.ctr2.mszip1.ts) {
out_level = 1;
- ctr1 = ctr.ctr2.ctr.mszip1.ctr1;
+ ctr1 = &ctr.ctr2.mszip1.ts->ctr1;
}
status = cli_get_session_key(mem_ctx, cli, &session_key);
@@ -527,9 +527,16 @@ static WERROR cmd_drsuapi_getncchanges(struct rpc_pipe_client *cli,
ctr6 = &ctr.ctr6;
} else if (level_out == 7
&& ctr.ctr7.level == 6
- && ctr.ctr7.type == DRSUAPI_COMPRESSION_TYPE_MSZIP) {
+ && ctr.ctr7.type == DRSUAPI_COMPRESSION_TYPE_MSZIP
+ && ctr.ctr7.ctr.mszip6.ts) {
out_level = 6;
- ctr6 = ctr.ctr7.ctr.mszip6.ctr6;
+ ctr6 = &ctr.ctr7.ctr.mszip6.ts->ctr6;
+ } else if (level_out == 7
+ && ctr.ctr7.level == 6
+ && ctr.ctr7.type == DRSUAPI_COMPRESSION_TYPE_XPRESS
+ && ctr.ctr7.ctr.xpress6.ts) {
+ out_level = 6;
+ ctr6 = &ctr.ctr7.ctr.xpress6.ts->ctr6;
}
if (out_level == 6) {
diff --git a/source3/rpcclient/cmd_lsarpc.c b/source3/rpcclient/cmd_lsarpc.c
index 5b5b4ff78c..aa8662ce9d 100644
--- a/source3/rpcclient/cmd_lsarpc.c
+++ b/source3/rpcclient/cmd_lsarpc.c
@@ -61,12 +61,11 @@ done:
static void display_query_info_1(struct lsa_AuditLogInfo *r)
{
d_printf("percent_full:\t%d\n", r->percent_full);
- d_printf("log_size:\t%d\n", r->log_size);
+ d_printf("maximum_log_size:\t%d\n", r->maximum_log_size);
d_printf("retention_time:\t%lld\n", (long long)r->retention_time);
d_printf("shutdown_in_progress:\t%d\n", r->shutdown_in_progress);
d_printf("time_to_shutdown:\t%lld\n", (long long)r->time_to_shutdown);
d_printf("next_audit_record:\t%d\n", r->next_audit_record);
- d_printf("unknown:\t%d\n", r->unknown);
}
static void display_query_info_2(struct lsa_AuditEventsInfo *r)
@@ -103,7 +102,6 @@ static void display_query_info_11(struct lsa_AuditFullQueryInfo *r)
{
d_printf("Shutdown on full: %d\n", r->shutdown_on_full);
d_printf("Log is full: %d\n", r->log_is_full);
- d_printf("Unknown: %d\n", r->unknown);
}
static void display_query_info_12(struct lsa_DnsDomainInfo *r)
@@ -112,8 +110,8 @@ static void display_query_info_12(struct lsa_DnsDomainInfo *r)
d_printf("Domain DNS Name: %s\n", r->dns_domain.string);
d_printf("Domain Forest Name: %s\n", r->dns_forest.string);
d_printf("Domain Sid: %s\n", sid_string_tos(r->sid));
- d_printf("Domain GUID: %s\n", smb_uuid_string(talloc_tos(),
- r->domain_guid));
+ d_printf("Domain GUID: %s\n", GUID_string(talloc_tos(),
+ &r->domain_guid));
}
static void display_lsa_query_info(union lsa_PolicyInformation *info,
@@ -1184,7 +1182,8 @@ static NTSTATUS cmd_lsa_get_username(struct rpc_pipe_client *cli,
/* Print results */
printf("Account Name: %s, Authority Name: %s\n",
- account_name->string, authority_name->string);
+ account_name->string, authority_name ? authority_name->string :
+ "");
rpccli_lsa_Close(cli, mem_ctx, &pol);
done:
diff --git a/source3/rpcclient/cmd_netlogon.c b/source3/rpcclient/cmd_netlogon.c
index 87ba65c14b..cdcc0ec28d 100644
--- a/source3/rpcclient/cmd_netlogon.c
+++ b/source3/rpcclient/cmd_netlogon.c
@@ -688,7 +688,7 @@ static NTSTATUS cmd_netlogon_sam_logon(struct rpc_pipe_client *cli,
const char **argv)
{
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
- int logon_type = NET_LOGON_TYPE;
+ int logon_type = NetlogonNetworkInformation;
const char *username, *password;
int auth_level = 2;
uint32 logon_param = 0;
diff --git a/source3/rpcclient/cmd_samr.c b/source3/rpcclient/cmd_samr.c
index fa1e0fda4d..3494e9123a 100644
--- a/source3/rpcclient/cmd_samr.c
+++ b/source3/rpcclient/cmd_samr.c
@@ -79,17 +79,17 @@ static void display_samr_user_info_21(struct samr_UserInfo21 *r)
dump_data(0, (uint8_t *)r->parameters.array, r->parameters.length*2);
printf("\tLogon Time :\t%s\n",
- http_timestring(nt_time_to_unix(r->last_logon)));
+ http_timestring(talloc_tos(), nt_time_to_unix(r->last_logon)));
printf("\tLogoff Time :\t%s\n",
- http_timestring(nt_time_to_unix(r->last_logoff)));
+ http_timestring(talloc_tos(), nt_time_to_unix(r->last_logoff)));
printf("\tKickoff Time :\t%s\n",
- http_timestring(nt_time_to_unix(r->acct_expiry)));
+ http_timestring(talloc_tos(), nt_time_to_unix(r->acct_expiry)));
printf("\tPassword last set Time :\t%s\n",
- http_timestring(nt_time_to_unix(r->last_password_change)));
+ http_timestring(talloc_tos(), nt_time_to_unix(r->last_password_change)));
printf("\tPassword can change Time :\t%s\n",
- http_timestring(nt_time_to_unix(r->allow_password_change)));
+ http_timestring(talloc_tos(), nt_time_to_unix(r->allow_password_change)));
printf("\tPassword must change Time:\t%s\n",
- http_timestring(nt_time_to_unix(r->force_password_change)));
+ http_timestring(talloc_tos(), nt_time_to_unix(r->force_password_change)));
printf("\tunknown_2[0..31]...\n"); /* user passwords? */
@@ -146,24 +146,24 @@ static void display_sam_dom_info_1(struct samr_DomInfo1 *info1)
display_time(info1->min_password_age));
}
-static void display_sam_dom_info_2(struct samr_DomInfo2 *info2)
+static void display_sam_dom_info_2(struct samr_DomGeneralInformation *general)
{
- printf("Domain:\t\t%s\n", info2->domain_name.string);
- printf("Server:\t\t%s\n", info2->primary.string);
- printf("Comment:\t%s\n", info2->comment.string);
+ printf("Domain:\t\t%s\n", general->domain_name.string);
+ printf("Server:\t\t%s\n", general->primary.string);
+ printf("Comment:\t%s\n", general->oem_information.string);
- printf("Total Users:\t%d\n", info2->num_users);
- printf("Total Groups:\t%d\n", info2->num_groups);
- printf("Total Aliases:\t%d\n", info2->num_aliases);
+ printf("Total Users:\t%d\n", general->num_users);
+ printf("Total Groups:\t%d\n", general->num_groups);
+ printf("Total Aliases:\t%d\n", general->num_aliases);
- printf("Sequence No:\t%llu\n", (unsigned long long)info2->sequence_num);
+ printf("Sequence No:\t%llu\n", (unsigned long long)general->sequence_num);
printf("Force Logoff:\t%d\n",
- (int)nt_time_to_unix_abs(&info2->force_logoff_time));
+ (int)nt_time_to_unix_abs(&general->force_logoff_time));
- printf("Unknown 2:\t0x%x\n", info2->unknown2);
- printf("Server Role:\t%s\n", server_role_str(info2->role));
- printf("Unknown 3:\t0x%x\n", info2->unknown3);
+ printf("Unknown 2:\t0x%x\n", general->unknown2);
+ printf("Server Role:\t%s\n", server_role_str(general->role));
+ printf("Unknown 3:\t0x%x\n", general->unknown3);
}
static void display_sam_dom_info_3(struct samr_DomInfo3 *info3)
@@ -172,9 +172,9 @@ static void display_sam_dom_info_3(struct samr_DomInfo3 *info3)
(int)nt_time_to_unix_abs(&info3->force_logoff_time));
}
-static void display_sam_dom_info_4(struct samr_DomInfo4 *info4)
+static void display_sam_dom_info_4(struct samr_DomOEMInformation *oem)
{
- printf("Comment:\t%s\n", info4->comment.string);
+ printf("Comment:\t%s\n", oem->oem_information.string);
}
static void display_sam_dom_info_5(struct samr_DomInfo5 *info5)
@@ -196,7 +196,7 @@ static void display_sam_dom_info_8(struct samr_DomInfo8 *info8)
{
printf("Sequence No:\t%llu\n", (unsigned long long)info8->sequence_num);
printf("Domain Create Time:\t%s\n",
- http_timestring(nt_time_to_unix(info8->domain_create_time)));
+ http_timestring(talloc_tos(), nt_time_to_unix(info8->domain_create_time)));
}
static void display_sam_dom_info_9(struct samr_DomInfo9 *info9)
@@ -218,7 +218,7 @@ static void display_sam_dom_info_13(struct samr_DomInfo13 *info13)
{
printf("Sequence No:\t%llu\n", (unsigned long long)info13->sequence_num);
printf("Domain Create Time:\t%s\n",
- http_timestring(nt_time_to_unix(info13->domain_create_time)));
+ http_timestring(talloc_tos(), nt_time_to_unix(info13->domain_create_time)));
printf("Unknown1:\t%d\n", info13->unknown1);
printf("Unknown2:\t%d\n", info13->unknown2);
@@ -1607,13 +1607,13 @@ static NTSTATUS cmd_samr_query_dominfo(struct rpc_pipe_client *cli,
display_sam_dom_info_1(&info->info1);
break;
case 2:
- display_sam_dom_info_2(&info->info2);
+ display_sam_dom_info_2(&info->general);
break;
case 3:
display_sam_dom_info_3(&info->info3);
break;
case 4:
- display_sam_dom_info_4(&info->info4);
+ display_sam_dom_info_4(&info->oem);
break;
case 5:
display_sam_dom_info_5(&info->info5);
diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c
index 2a9f2b82bb..378ec891a7 100644
--- a/source3/rpcclient/cmd_spoolss.c
+++ b/source3/rpcclient/cmd_spoolss.c
@@ -691,7 +691,7 @@ static void display_reg_value(REGISTRY_VALUE value)
printf("%s: REG_SZ: %s\n", value.valuename, text ? text : "");
break;
case REG_BINARY: {
- char *hex = hex_encode(NULL, value.data_p, value.size);
+ char *hex = hex_encode_talloc(NULL, value.data_p, value.size);
size_t i, len;
printf("%s: REG_BINARY:", value.valuename);
len = strlen(hex);