summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-05-08 14:42:45 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:51:48 -0500
commit35ffc464541366ba1da0a332afae203b68512010 (patch)
tree593e24ecc08f6ca8aa02de76647c5c0eee5323d8 /source4/lib
parent8c2636f59a48f327b26ebfc05386fa06e8c4841a (diff)
downloadsamba-35ffc464541366ba1da0a332afae203b68512010.tar.gz
samba-35ffc464541366ba1da0a332afae203b68512010.tar.bz2
samba-35ffc464541366ba1da0a332afae203b68512010.zip
r587: added server code for samr_EnumDomainUsers, and started adding
samr_SetUserInfo and samr_QueryUserInfo (This used to be commit e0db9659a85b59e52fbe033a94b411d6c64d9f9c)
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/time.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/source4/lib/time.c b/source4/lib/time.c
index 0bc5fcd3fc..65b85b2180 100644
--- a/source4/lib/time.c
+++ b/source4/lib/time.c
@@ -428,3 +428,21 @@ NTTIME pull_nttime(void *base, uint16 offset)
return ret;
}
+
+/*
+ parse a nttime as a integer in a string and return a NTTIME
+*/
+NTTIME nttime_from_string(const char *s)
+{
+ double t = 0;
+ const double t32 = 4294967296.0;
+ NTTIME ret;
+ /* i wish we could rely on 64 bit systems and sscanf %llu */
+ if (sscanf(s, "%lf", &t) != 1) {
+ ret.low = 0;
+ ret.high = 0;
+ }
+ ret.high = t / t32;
+ ret.low = t - (ret.high*t32);
+ return ret;
+}