The attribute is supposed to contain number of days since the epoch, not
the number of seconds.

Thanks
Jan
>From 1617a26db2be39de7dc1b34ed366640461e885c4 Mon Sep 17 00:00:00 2001
From: Jan Zeleny <jzel...@redhat.com>
Date: Mon, 16 Jul 2012 08:42:27 -0400
Subject: [PATCH] Fixed wrong number in shadowLastChange

The attribute is supposed to contain number of days since the epoch, not
the number of seconds.
---
 src/providers/ldap/sdap_async.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/providers/ldap/sdap_async.c b/src/providers/ldap/sdap_async.c
index 4b28692206127e721f8aa01a8b781ed09dbb3728..42c8dd6805f4321b131ab799384bb388f2eadfb2 100644
--- a/src/providers/ldap/sdap_async.c
+++ b/src/providers/ldap/sdap_async.c
@@ -744,7 +744,8 @@ sdap_modify_shadow_lastchange_send(TALLOC_CTX *mem_ctx,
         ret = ENOMEM;
         goto done;
     }
-    values[0] = talloc_asprintf(values, "%ld", (long)time(NULL));
+    /* The attribute contains number of days since the epoch */
+    values[0] = talloc_asprintf(values, "%ld", (long)time(NULL)/86400);
     if (values[0] == NULL) {
         ret = ENOMEM;
         goto done;
-- 
1.7.7.6

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
sssd-devel mailing list
sssd-devel@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/sssd-devel

Reply via email to