From 6f3008e62714d46beed96e0f834340f81fa3c0c0 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 15 Feb 2011 21:42:35 +0100 Subject: s3: Let pdb_ads write accountExpires --- source3/passdb/pdb_ads.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'source3/passdb') diff --git a/source3/passdb/pdb_ads.c b/source3/passdb/pdb_ads.c index b8ed83abf7..ffc70565d8 100644 --- a/source3/passdb/pdb_ads.c +++ b/source3/passdb/pdb_ads.c @@ -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; } -- cgit