summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-02-04 21:44:57 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:06:26 -0500
commitda979c9e7eb0c03ac718eb2c6c50937e52c39292 (patch)
treee5102a3b4a444da0942e0e4e7c4d8277f18e72b9 /source3/lib
parent9ca890e414bddf093ef09f1219b5347cb3b16625 (diff)
downloadsamba-da979c9e7eb0c03ac718eb2c6c50937e52c39292.tar.gz
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 (This used to be commit fc73690a7000d5a3f0f5ad34461c1f3a87edeac5)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/time.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/source3/lib/time.c b/source3/lib/time.c
index 989589121b..f87e53fef5 100644
--- a/source3/lib/time.c
+++ b/source3/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);
}