diff options
author | Volker Lendecke <vlendec@samba.org> | 2006-02-04 21:44:57 +0000 |
---|---|---|
committer | Volker Lendecke <vlendec@samba.org> | 2006-02-04 21:44:57 +0000 |
commit | dd1979cea3c48782e00848d0ac09e386a78e5eff (patch) | |
tree | 5b9c93adde6247bc6f129f3cc980f3f5d182df20 /source/lib | |
parent | b43ce5cea716ebae55f7d56837f5b60ec33a50da (diff) | |
download | samba-dd1979cea3c48782e00848d0ac09e386a78e5eff.tar.gz samba-dd1979cea3c48782e00848d0ac09e386a78e5eff.tar.xz samba-dd1979cea3c48782e00848d0ac09e386a78e5eff.zip |
r13350: Implement rpccli_samr_set_domain_info. Weird that it was not around :-)
Implement 'net rpc shell account' -- An editor for account policies
nt_time_to_unix_abs changed its argument which to me seems wrong, and I could
not find a caller that depends on this. So I changed it. Applied some more
const in time.c.
Volker
Diffstat (limited to 'source/lib')
-rw-r--r-- | source/lib/time.c | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/source/lib/time.c b/source/lib/time.c index 989589121b9..f87e53fef52 100644 --- a/source/lib/time.c +++ b/source/lib/time.c @@ -231,7 +231,7 @@ time_t nt_time_to_unix(NTTIME *nt) if the NTTIME was 5 seconds, the time_t is 5 seconds. JFM ****************************************************************************/ -time_t nt_time_to_unix_abs(NTTIME *nt) +time_t nt_time_to_unix_abs(const NTTIME *nt) { double d; time_t ret; @@ -239,6 +239,7 @@ time_t nt_time_to_unix_abs(NTTIME *nt) broken SCO compiler. JRA. */ time_t l_time_min = TIME_T_MIN; time_t l_time_max = TIME_T_MAX; + NTTIME neg_nt; if (nt->high == 0) { return(0); @@ -250,11 +251,11 @@ time_t nt_time_to_unix_abs(NTTIME *nt) /* reverse the time */ /* it's a negative value, turn it to positive */ - nt->high=~nt->high; - nt->low=~nt->low; + neg_nt.high=~nt->high; + neg_nt.low=~nt->low; - d = ((double)nt->high)*4.0*(double)(1<<30); - d += (nt->low&0xFFF00000); + d = ((double)neg_nt.high)*4.0*(double)(1<<30); + d += (neg_nt.low&0xFFF00000); d *= 1.0e-7; if (!(l_time_min <= d && d <= l_time_max)) { @@ -728,11 +729,24 @@ void init_nt_time(NTTIME *nt) nt->low = 0xFFFFFFFF; } +BOOL nt_time_is_set(const NTTIME *nt) +{ + if ((nt->high == 0x7FFFFFFF) && (nt->low == 0xFFFFFFFF)) { + return False; + } + + if ((nt->high == 0x80000000) && (nt->low == 0)) { + return False; + } + + return True; +} + /**************************************************************************** Check if NTTIME is 0. ****************************************************************************/ -BOOL nt_time_is_zero(NTTIME *nt) +BOOL nt_time_is_zero(const NTTIME *nt) { if(nt->high==0) { return True; @@ -744,7 +758,7 @@ BOOL nt_time_is_zero(NTTIME *nt) Check if two NTTIMEs are the same. ****************************************************************************/ -BOOL nt_time_equals(NTTIME *nt1, NTTIME *nt2) +BOOL nt_time_equals(const NTTIME *nt1, const NTTIME *nt2) { return (nt1->high == nt2->high && nt1->low == nt2->low); } |