summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-12-29 11:37:17 +1100
committerAndrew Tridgell <tridge@samba.org>2010-01-02 08:16:55 +1100
commitc3061794ef4d03d5b26d4a221a93722b3ed08197 (patch)
tree9d66a5b128ec686cc60a64579c5337e2eb8d485f /source4/dsdb/samdb
parentbaae6ef9d24a59f794a8cbc9aa0ccdbbeb2ed369 (diff)
downloadsamba-c3061794ef4d03d5b26d4a221a93722b3ed08197.tar.gz
samba-c3061794ef4d03d5b26d4a221a93722b3ed08197.tar.bz2
samba-c3061794ef4d03d5b26d4a221a93722b3ed08197.zip
s4-dsdb: use ldb_val_to_time() instead of ldb_string_to_time()
Diffstat (limited to 'source4/dsdb/samdb')
-rw-r--r--source4/dsdb/samdb/ldb_modules/simple_ldap_map.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/simple_ldap_map.c b/source4/dsdb/samdb/ldb_modules/simple_ldap_map.c
index 43402248c0..bf9cd4fdda 100644
--- a/source4/dsdb/samdb/ldb_modules/simple_ldap_map.c
+++ b/source4/dsdb/samdb/ldb_modules/simple_ldap_map.c
@@ -181,7 +181,7 @@ static struct ldb_val usn_to_entryCSN(struct ldb_module *module, TALLOC_CTX *ctx
static unsigned long long entryCSN_to_usn_int(TALLOC_CTX *ctx, const struct ldb_val *val)
{
- char *entryCSN = talloc_strdup(ctx, (const char *)val->data);
+ char *entryCSN = talloc_strndup(ctx, (const char *)val->data, val->length);
char *mod_per_sec;
time_t t;
unsigned long long usn;
@@ -232,10 +232,10 @@ static struct ldb_val usn_to_timestamp(struct ldb_module *module, TALLOC_CTX *ct
static struct ldb_val timestamp_to_usn(struct ldb_module *module, TALLOC_CTX *ctx, const struct ldb_val *val)
{
struct ldb_val out;
- time_t t;
+ time_t t=0;
unsigned long long usn;
- t = ldb_string_to_time((const char *)val->data);
+ ldb_val_to_time(val, &t);
usn = ((unsigned long long)t <<24);