s3: Let pdb_ads write accountExpires
authorVolker Lendecke <vl@samba.org>
Tue, 15 Feb 2011 20:42:35 +0000 (21:42 +0100)
committerVolker Lendecke <vl@samba.org>
Sat, 19 Feb 2011 10:32:49 +0000 (11:32 +0100)
source3/passdb/pdb_ads.c

index b8ed83abf70cd993dc364f903d145640925cabc0..ffc70565d88ab141ce167b4ae5aabb32a079550c 100644 (file)
@@ -319,6 +319,20 @@ fail:
        return status;
 }
 
+static bool pdb_ads_make_time_mod(struct tldap_message *existing,
+                                 TALLOC_CTX *mem_ctx,
+                                 struct tldap_mod **pmods, int *pnum_mods,
+                                 const char *attrib, time_t t)
+{
+       uint64_t nt_time;
+
+       unix_to_nt_time(&nt_time, t);
+
+       return tldap_make_mod_fmt(
+               existing, mem_ctx, pmods, pnum_mods, attrib,
+               "%llu", nt_time);
+}
+
 static bool pdb_ads_init_ads_from_sam(struct pdb_ads_state *state,
                                      struct tldap_message *existing,
                                      TALLOC_CTX *mem_ctx,
@@ -412,6 +426,10 @@ static bool pdb_ads_init_ads_from_sam(struct pdb_ads_state *state,
                existing, mem_ctx, pmods, pnum_mods, "codePage",
                "%i", (int)pdb_get_code_page(sam));
 
+       ret &= pdb_ads_make_time_mod(
+               existing, mem_ctx, pmods, pnum_mods, "accountExpires",
+               (int)pdb_get_kickoff_time(sam));
+
 fail:
        return ret;
 }