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/utils | |
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/utils')
-rw-r--r-- | source3/utils/net_rpc.c | 2 | ||||
-rw-r--r-- | source3/utils/net_rpc_samsync.c | 59 |
2 files changed, 11 insertions, 50 deletions
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c index f2cd4adb17..e0c361822d 100644 --- a/source3/utils/net_rpc.c +++ b/source3/utils/net_rpc.c @@ -462,7 +462,7 @@ NTSTATUS rpc_info_internals(const DOM_SID *domain_sid, TALLOC_CTX *ctx = talloc_init("rpc_info_internals"); d_printf("Domain Name: %s\n", unistr2_tdup(ctx, &ctr.info.inf2.uni_domain)); d_printf("Domain SID: %s\n", sid_str); - d_printf("Sequence number: %u\n", ctr.info.inf2.seq_num.low); + d_printf("Sequence number: %llu\n", ctr.info.inf2.seq_num); d_printf("Num users: %u\n", ctr.info.inf2.num_domain_usrs); d_printf("Num domain groups: %u\n", ctr.info.inf2.num_domain_grps); d_printf("Num local groups: %u\n", ctr.info.inf2.num_local_grps); diff --git a/source3/utils/net_rpc_samsync.c b/source3/utils/net_rpc_samsync.c index bbe09a3b35..0b54a6c97f 100644 --- a/source3/utils/net_rpc_samsync.c +++ b/source3/utils/net_rpc_samsync.c @@ -42,44 +42,6 @@ static void display_group_mem_info(uint32 rid, SAM_GROUP_MEM_INFO *g) d_printf("\n"); } -static const char *display_time(const UINT64_S *nttime) -{ - static fstring string; - - float high; - float low; - int sec; - int days, hours, mins, secs; - int offset = 1; - - 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; - sec+=offset; - - 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_alias_info(uint32 rid, SAM_ALIAS_INFO *a) { d_printf("Alias '%s' ", unistr2_static(&a->uni_als_name)); @@ -123,11 +85,10 @@ static void display_account_info(uint32 rid, SAM_ACCOUNT_INFO *a) pdb_encode_acct_ctrl(a->acb_info, NEW_PW_FORMAT_SPACE_PADDED_LEN)); } -static time_t uint64s_nt_time_to_unix_abs(const UINT64_S *src) +static time_t uint64s_nt_time_to_unix_abs(const uint64 *src) { NTTIME nttime; - nttime.high = src->high; - nttime.low = src->low; + nttime = *src; return nt_time_to_unix_abs(&nttime); } @@ -144,11 +105,11 @@ static void display_domain_info(SAM_DOMAIN_INFO *a) d_printf("Force Logoff: %d\n", (int)u_logout); - d_printf("Max Password Age: %s\n", display_time(&a->max_pwd_age)); - d_printf("Min Password Age: %s\n", display_time(&a->min_pwd_age)); + d_printf("Max Password Age: %s\n", display_time(a->max_pwd_age)); + d_printf("Min Password Age: %s\n", display_time(a->min_pwd_age)); - d_printf("Lockout Time: %s\n", display_time(&a->account_lockout.lockout_duration)); - d_printf("Lockout Reset Time: %s\n", display_time(&a->account_lockout.reset_count)); + d_printf("Lockout Time: %s\n", display_time(a->account_lockout.lockout_duration)); + d_printf("Lockout Reset Time: %s\n", display_time(a->account_lockout.reset_count)); d_printf("Bad Attempt Lockout: %d\n", a->account_lockout.bad_attempt_lockout); d_printf("User must logon to change password: %d\n", a->logon_chgpass); @@ -420,14 +381,14 @@ static NTSTATUS sam_account_from_delta(struct samu *account, SAM_ACCOUNT_INFO *d /* Logon and password information */ if (!nt_time_is_zero(&delta->logon_time)) { - unix_time = nt_time_to_unix(&delta->logon_time); + unix_time = nt_time_to_unix(delta->logon_time); stored_time = pdb_get_logon_time(account); if (stored_time != unix_time) pdb_set_logon_time(account, unix_time, PDB_CHANGED); } if (!nt_time_is_zero(&delta->logoff_time)) { - unix_time = nt_time_to_unix(&delta->logoff_time); + unix_time = nt_time_to_unix(delta->logoff_time); stored_time = pdb_get_logoff_time(account); if (stored_time != unix_time) pdb_set_logoff_time(account, unix_time,PDB_CHANGED); @@ -463,7 +424,7 @@ static NTSTATUS sam_account_from_delta(struct samu *account, SAM_ACCOUNT_INFO *d pdb_set_logon_count(account, delta->logon_count, PDB_CHANGED); if (!nt_time_is_zero(&delta->pwd_last_set_time)) { - unix_time = nt_time_to_unix(&delta->pwd_last_set_time); + unix_time = nt_time_to_unix(delta->pwd_last_set_time); stored_time = pdb_get_pass_last_set_time(account); if (stored_time != unix_time) pdb_set_pass_last_set_time(account, unix_time, PDB_CHANGED); @@ -1632,7 +1593,7 @@ static NTSTATUS fetch_account_info_to_ldif(SAM_DELTA_CTR *delta, } else { pdb_sethexpwd(hex_nt_passwd, NULL, 0); } - unix_time = nt_time_to_unix(&(delta->account_info.pwd_last_set_time)); + unix_time = nt_time_to_unix(delta->account_info.pwd_last_set_time); /* The nobody user is entered by populate_ldap_for_ldif */ if (strcmp(username, "nobody") == 0) { |