From 86910e15feaa490cf70f592c6e9af44f3db7e6f0 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Thu, 19 Apr 2012 11:16:03 -0400 Subject: loadparm: Add helper function to fetch default lifetime policies This use long to fetch time_t quantities, because there are architectures were time_t is a signed long but long != int, So long is the proper way to deal with it. --- lib/param/param.h | 5 +++++ lib/param/util.c | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+) (limited to 'lib') diff --git a/lib/param/param.h b/lib/param/param.h index 079ef8b9a6..7842a843f6 100644 --- a/lib/param/param.h +++ b/lib/param/param.h @@ -297,6 +297,11 @@ struct smb_iconv_handle *smb_iconv_handle_reinit_lp(TALLOC_CTX *mem_ctx, const char *lpcfg_sam_name(struct loadparm_context *lp_ctx); +void lpcfg_default_kdc_policy(struct loadparm_context *lp_ctx, + time_t *svc_tkt_lifetime, + time_t *usr_tkt_lifetime, + time_t *renewal_lifetime); + /* The following definitions come from lib/version.c */ const char *samba_version_string(void); diff --git a/lib/param/util.c b/lib/param/util.c index 3a6a004043..f60abb9773 100644 --- a/lib/param/util.c +++ b/lib/param/util.c @@ -266,3 +266,22 @@ const char *lpcfg_sam_name(struct loadparm_context *lp_ctx) } } +void lpcfg_default_kdc_policy(struct loadparm_context *lp_ctx, + time_t *svc_tkt_lifetime, + time_t *usr_tkt_lifetime, + time_t *renewal_lifetime) +{ + long val; + + val = lpcfg_parm_long(lp_ctx, NULL, + "kdc", "service ticket lifetime", 10); + *svc_tkt_lifetime = val * 60 * 60; + + val = lpcfg_parm_long(lp_ctx, NULL, + "kdc", "user ticket lifetime", 10); + *usr_tkt_lifetime = val * 60 * 60; + + val = lpcfg_parm_long(lp_ctx, NULL, + "kdc", "renewal lifetime", 24 * 7); + *renewal_lifetime = val * 60 * 60; +} -- cgit