summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-02-16 16:33:21 +0100
committerVolker Lendecke <vlendec@samba.org>2011-02-19 12:22:08 +0100
commit9971061a9d17c2eb4bf1e8ea5691bec2b127072e (patch)
treeff8da9259e4e02043ceb56166b4bbc6d0a05eb63
parent943aac2e366b781136cfff467b7ea5631890ebdd (diff)
downloadsamba-9971061a9d17c2eb4bf1e8ea5691bec2b127072e.tar.gz
samba-9971061a9d17c2eb4bf1e8ea5691bec2b127072e.tar.bz2
samba-9971061a9d17c2eb4bf1e8ea5691bec2b127072e.zip
s3: Pass logonHours through pdb_ads
Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Sat Feb 19 12:22:08 CET 2011 on sn-devel-104
-rw-r--r--source3/passdb/pdb_ads.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/source3/passdb/pdb_ads.c b/source3/passdb/pdb_ads.c
index ffc70565d8..bcb803b396 100644
--- a/source3/passdb/pdb_ads.c
+++ b/source3/passdb/pdb_ads.c
@@ -313,6 +313,24 @@ static NTSTATUS pdb_ads_init_sam_from_priv(struct pdb_methods *m,
pdb_set_code_page(sam, i, PDB_SET);
}
+ if (tldap_get_single_valueblob(entry, "logonHours", &blob)) {
+
+ if (blob.length > MAX_HOURS_LEN) {
+ status = NT_STATUS_INVALID_PARAMETER;
+ goto fail;
+ }
+ pdb_set_logon_divs(sam, blob.length * 8, PDB_SET);
+ pdb_set_hours_len(sam, blob.length, PDB_SET);
+ pdb_set_hours(sam, blob.data, blob.length, PDB_SET);
+
+ } else {
+ uint8_t hours[21];
+ pdb_set_logon_divs(sam, sizeof(hours)/8, PDB_SET);
+ pdb_set_hours_len(sam, sizeof(hours), PDB_SET);
+ memset(hours, 0xff, sizeof(hours));
+ pdb_set_hours(sam, hours, sizeof(hours), PDB_SET);
+ }
+
status = NT_STATUS_OK;
fail:
TALLOC_FREE(frame);
@@ -430,6 +448,10 @@ static bool pdb_ads_init_ads_from_sam(struct pdb_ads_state *state,
existing, mem_ctx, pmods, pnum_mods, "accountExpires",
(int)pdb_get_kickoff_time(sam));
+ ret &= tldap_make_mod_blob(
+ existing, mem_ctx, pmods, pnum_mods, "logonHours",
+ data_blob_const(pdb_get_hours(sam), pdb_get_hours_len(sam)));
+
fail:
return ret;
}