summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-02-15 21:42:35 +0100
committerVolker Lendecke <vl@samba.org>2011-02-19 11:32:49 +0100
commit6f3008e62714d46beed96e0f834340f81fa3c0c0 (patch)
tree3d45198d52e627ff2daea76280bdd4c73903b095
parent478d74fe1447c4588b14ef7040c8c13339d54026 (diff)
downloadsamba-6f3008e62714d46beed96e0f834340f81fa3c0c0.tar.gz
samba-6f3008e62714d46beed96e0f834340f81fa3c0c0.tar.bz2
samba-6f3008e62714d46beed96e0f834340f81fa3c0c0.zip
s3: Let pdb_ads write accountExpires
-rw-r--r--source3/passdb/pdb_ads.c18
1 files changed, 18 insertions, 0 deletions
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;
}