1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

s3: Let pdb_ads write accountExpires

This commit is contained in:
Volker Lendecke 2011-02-15 21:42:35 +01:00
parent 478d74fe14
commit 6f3008e627

View 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;
}