diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2006-09-06 18:32:20 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:43:56 -0500 |
commit | 995205fc60f87e1a02aa1c6f309db55ae18e908a (patch) | |
tree | bf796212b1c95b755ef07b1a91b7e26e45dbbd87 /source3/rpcclient | |
parent | a7be2ec7c5eb8bda76eaec0eaff7e1a7b2b39433 (diff) | |
download | samba-995205fc60f87e1a02aa1c6f309db55ae18e908a.tar.gz samba-995205fc60f87e1a02aa1c6f309db55ae18e908a.tar.bz2 samba-995205fc60f87e1a02aa1c6f309db55ae18e908a.zip |
r18188: merge 3.0-libndr branch
(This used to be commit 1115745caed3093c25d6be01ffee21819fb0a675)
Diffstat (limited to 'source3/rpcclient')
-rw-r--r-- | source3/rpcclient/cmd_lsarpc.c | 4 | ||||
-rw-r--r-- | source3/rpcclient/cmd_netlogon.c | 5 | ||||
-rw-r--r-- | source3/rpcclient/cmd_samr.c | 56 | ||||
-rw-r--r-- | source3/rpcclient/cmd_unixinfo.c | 32 |
4 files changed, 31 insertions, 66 deletions
diff --git a/source3/rpcclient/cmd_lsarpc.c b/source3/rpcclient/cmd_lsarpc.c index 3967ed6957..4c65341740 100644 --- a/source3/rpcclient/cmd_lsarpc.c +++ b/source3/rpcclient/cmd_lsarpc.c @@ -63,9 +63,9 @@ static void display_query_info_1(DOM_QUERY_1 d) { d_printf("percent_full:\t%d\n", d.percent_full); d_printf("log_size:\t%d\n", d.log_size); - d_printf("retention_time:\t%08x %08x\n", d.retention_time.high, d.retention_time.low); + d_printf("retention_time:\t%lld\n", d.retention_time); d_printf("shutdown_in_progress:\t%d\n", d.shutdown_in_progress); - d_printf("time_to_shutdown:\t%08x %08x\n", d.time_to_shutdown.high, d.time_to_shutdown.low); + d_printf("time_to_shutdown:\t%lld\n", d.time_to_shutdown); d_printf("next_audit_record:\t%d\n", d.next_audit_record); d_printf("unknown:\t%d\n", d.unknown); } diff --git a/source3/rpcclient/cmd_netlogon.c b/source3/rpcclient/cmd_netlogon.c index 35b8accdb6..ee0fc2e14c 100644 --- a/source3/rpcclient/cmd_netlogon.c +++ b/source3/rpcclient/cmd_netlogon.c @@ -263,7 +263,7 @@ static NTSTATUS cmd_netlogon_sam_deltas(struct rpc_pipe_client *cli, uint32 database_id, num_deltas, tmp; SAM_DELTA_HDR *hdr_deltas; SAM_DELTA_CTR *deltas; - UINT64_S seqnum; + uint64 seqnum; if (argc != 3) { fprintf(stderr, "Usage: %s database_id seqnum\n", argv[0]); @@ -273,8 +273,7 @@ static NTSTATUS cmd_netlogon_sam_deltas(struct rpc_pipe_client *cli, database_id = atoi(argv[1]); tmp = atoi(argv[2]); - seqnum.low = tmp & 0xffff; - seqnum.high = 0; + seqnum = tmp & 0xffff; result = rpccli_netlogon_sam_deltas(cli, mem_ctx, database_id, seqnum, &num_deltas, diff --git a/source3/rpcclient/cmd_samr.c b/source3/rpcclient/cmd_samr.c index 2aab35ea3c..8b3e3cac92 100644 --- a/source3/rpcclient/cmd_samr.c +++ b/source3/rpcclient/cmd_samr.c @@ -84,17 +84,17 @@ static void display_sam_user_info_21(SAM_USER_INFO_21 *usr) printf("\tRemote Dial :\t%s\n", temp); printf("\tLogon Time :\t%s\n", - http_timestring(nt_time_to_unix(&usr->logon_time))); + http_timestring(nt_time_to_unix(usr->logon_time))); printf("\tLogoff Time :\t%s\n", - http_timestring(nt_time_to_unix(&usr->logoff_time))); + http_timestring(nt_time_to_unix(usr->logoff_time))); printf("\tKickoff Time :\t%s\n", - http_timestring(nt_time_to_unix(&usr->kickoff_time))); + http_timestring(nt_time_to_unix(usr->kickoff_time))); printf("\tPassword last set Time :\t%s\n", - http_timestring(nt_time_to_unix(&usr->pass_last_set_time))); + http_timestring(nt_time_to_unix(usr->pass_last_set_time))); printf("\tPassword can change Time :\t%s\n", - http_timestring(nt_time_to_unix(&usr->pass_can_change_time))); + http_timestring(nt_time_to_unix(usr->pass_can_change_time))); printf("\tPassword must change Time:\t%s\n", - http_timestring(nt_time_to_unix(&usr->pass_must_change_time))); + http_timestring(nt_time_to_unix(usr->pass_must_change_time))); printf("\tunknown_2[0..31]...\n"); /* user passwords? */ @@ -114,40 +114,6 @@ static void display_sam_user_info_21(SAM_USER_INFO_21 *usr) } } -static const char *display_time(NTTIME nttime) -{ - static fstring string; - - float high; - float low; - int sec; - int days, hours, mins, secs; - - if (nttime.high==0 && nttime.low==0) - return "Now"; - - if (nttime.high==0x80000000 && nttime.low==0) - return "Never"; - - high = 65536; - high = high/10000; - high = high*65536; - high = high/1000; - high = high * (~nttime.high); - - low = ~nttime.low; - low = low/(1000*1000*10); - - sec=high+low; - - days=sec/(60*60*24); - hours=(sec - (days*60*60*24)) / (60*60); - mins=(sec - (days*60*60*24) - (hours*60*60) ) / 60; - secs=sec - (days*60*60*24) - (hours*60*60) - (mins*60); - - fstr_sprintf(string, "%u days, %u hours, %u minutes, %u seconds", days, hours, mins, secs); - return (string); -} static void display_password_properties(uint32 password_properties) { @@ -199,7 +165,7 @@ static void display_sam_unk_info_2(SAM_UNK_INFO_2 *info2) printf("Total Groups:\t%d\n", info2->num_domain_grps); printf("Total Aliases:\t%d\n", info2->num_local_grps); - printf("Sequence No:\t%d\n", info2->seq_num.low); + printf("Sequence No:\t%lld\n", info2->seq_num); printf("Force Logoff:\t%d\n", (int)nt_time_to_unix_abs(&info2->logout)); @@ -244,9 +210,9 @@ static void display_sam_unk_info_7(SAM_UNK_INFO_7 *info7) static void display_sam_unk_info_8(SAM_UNK_INFO_8 *info8) { - printf("Sequence No:\t%d\n", info8->seq_num.low); + printf("Sequence No:\t%lld\n", info8->seq_num); printf("Domain Create Time:\t%s\n", - http_timestring(nt_time_to_unix(&info8->domain_create_time))); + http_timestring(nt_time_to_unix(info8->domain_create_time))); } static void display_sam_unk_info_9(SAM_UNK_INFO_9 *info9) @@ -263,9 +229,9 @@ static void display_sam_unk_info_12(SAM_UNK_INFO_12 *info12) static void display_sam_unk_info_13(SAM_UNK_INFO_13 *info13) { - printf("Sequence No:\t%d\n", info13->seq_num.low); + printf("Sequence No:\t%lld\n", info13->seq_num); printf("Domain Create Time:\t%s\n", - http_timestring(nt_time_to_unix(&info13->domain_create_time))); + http_timestring(nt_time_to_unix(info13->domain_create_time))); printf("Unknown1:\t%d\n", info13->unknown1); printf("Unknown2:\t%d\n", info13->unknown2); diff --git a/source3/rpcclient/cmd_unixinfo.c b/source3/rpcclient/cmd_unixinfo.c index 2e9ab10652..762a795bbc 100644 --- a/source3/rpcclient/cmd_unixinfo.c +++ b/source3/rpcclient/cmd_unixinfo.c @@ -21,6 +21,7 @@ #include "includes.h" #include "rpcclient.h" +#include "rpc_client/cli_unixinfo.h" static NTSTATUS cmd_unixinfo_uid2sid(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, @@ -36,8 +37,7 @@ static NTSTATUS cmd_unixinfo_uid2sid(struct rpc_pipe_client *cli, } uid = atoi(argv[1]); - - result = rpccli_unixinfo_uid2sid(cli, mem_ctx, uid, &sid); + result = rpccli_unixinfo_UidToSid(cli, mem_ctx, uid, &sid); if (!NT_STATUS_IS_OK(result)) goto done; @@ -52,7 +52,7 @@ static NTSTATUS cmd_unixinfo_sid2uid(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, int argc, const char **argv) { - uid_t uid; + uint64_t uid; DOM_SID sid; NTSTATUS result; @@ -66,12 +66,12 @@ static NTSTATUS cmd_unixinfo_sid2uid(struct rpc_pipe_client *cli, goto done; } - result = rpccli_unixinfo_sid2uid(cli, mem_ctx, &sid, &uid); + result = rpccli_unixinfo_SidToUid(cli, mem_ctx, sid, &uid); if (!NT_STATUS_IS_OK(result)) goto done; - printf("%u\n", uid); + printf("%llu\n", uid); done: return result; @@ -92,7 +92,7 @@ static NTSTATUS cmd_unixinfo_gid2sid(struct rpc_pipe_client *cli, gid = atoi(argv[1]); - result = rpccli_unixinfo_gid2sid(cli, mem_ctx, gid, &sid); + result = rpccli_unixinfo_GidToSid(cli, mem_ctx, gid, &sid); if (!NT_STATUS_IS_OK(result)) goto done; @@ -107,7 +107,7 @@ static NTSTATUS cmd_unixinfo_sid2gid(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, int argc, const char **argv) { - gid_t gid; + uint64_t gid; DOM_SID sid; NTSTATUS result; @@ -121,12 +121,12 @@ static NTSTATUS cmd_unixinfo_sid2gid(struct rpc_pipe_client *cli, goto done; } - result = rpccli_unixinfo_sid2gid(cli, mem_ctx, &sid, &gid); + result = rpccli_unixinfo_SidToGid(cli, mem_ctx, sid, &gid); if (!NT_STATUS_IS_OK(result)) goto done; - printf("%u\n", gid); + printf("%llu\n", gid); done: return result; @@ -136,9 +136,9 @@ static NTSTATUS cmd_unixinfo_getpwuid(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, int argc, const char **argv) { - uid_t *uids; - int i, num_uids; - struct unixinfo_getpwuid *info; + uint64_t *uids; + unsigned int i, num_uids; + struct unixinfo_GetPWUidInfo *info; NTSTATUS result; if (argc < 2) { @@ -147,7 +147,7 @@ static NTSTATUS cmd_unixinfo_getpwuid(struct rpc_pipe_client *cli, } num_uids = argc-1; - uids = TALLOC_ARRAY(mem_ctx, uid_t, num_uids); + uids = TALLOC_ARRAY(mem_ctx, uint64_t, num_uids); if (uids == NULL) { return NT_STATUS_NO_MEMORY; @@ -157,7 +157,7 @@ static NTSTATUS cmd_unixinfo_getpwuid(struct rpc_pipe_client *cli, uids[i] = atoi(argv[i+1]); } - result = rpccli_unixinfo_getpwuid(cli, mem_ctx, num_uids, uids, &info); + result = rpccli_unixinfo_GetPWUid(cli, mem_ctx, &num_uids, uids, &info); if (!NT_STATUS_IS_OK(result)) { return result; @@ -165,10 +165,10 @@ static NTSTATUS cmd_unixinfo_getpwuid(struct rpc_pipe_client *cli, for (i=0; i<num_uids; i++) { if (NT_STATUS_IS_OK(info[i].status)) { - printf("%d:%s:%s\n", uids[i], info[i].homedir, + printf("%llu:%s:%s\n", uids[i], info[i].homedir, info[i].shell); } else { - printf("%d:%s\n", uids[i], nt_errstr(info[i].status)); + printf("%llu:%s\n", uids[i], nt_errstr(info[i].status)); } } |