summaryrefslogtreecommitdiffstats
path: root/src/providers/krb5/krb5_child.c
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2010-11-08 16:00:57 +0100
committerStephen Gallagher <sgallagh@redhat.com>2010-12-03 10:41:28 -0500
commitc8b8901b05da9e31dba320f305ec20301e928cfb (patch)
treed503cc9d102a727a100dd6e599290e862f64cdb0 /src/providers/krb5/krb5_child.c
parent7470bb938429c7a723f5aad971cc50a805a9ead8 (diff)
downloadsssd-c8b8901b05da9e31dba320f305ec20301e928cfb.tar.gz
sssd-c8b8901b05da9e31dba320f305ec20301e928cfb.tar.xz
sssd-c8b8901b05da9e31dba320f305ec20301e928cfb.zip
Add krb5_renewable_lifetime option
Diffstat (limited to 'src/providers/krb5/krb5_child.c')
-rw-r--r--src/providers/krb5/krb5_child.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/providers/krb5/krb5_child.c b/src/providers/krb5/krb5_child.c
index 0e5556048..2a2ed9b47 100644
--- a/src/providers/krb5/krb5_child.c
+++ b/src/providers/krb5/krb5_child.c
@@ -1084,6 +1084,8 @@ static int krb5_cleanup(void *ptr)
static int krb5_child_setup(struct krb5_req *kr, uint32_t offline)
{
krb5_error_code kerr = 0;
+ char *lifetime_str;
+ krb5_deltat lifetime;
kr->krb5_ctx = talloc_zero(kr, struct krb5_child_ctx);
if (kr->krb5_ctx == NULL) {
@@ -1162,9 +1164,23 @@ static int krb5_child_setup(struct krb5_req *kr, uint32_t offline)
goto failed;
}
+ lifetime_str = getenv(SSSD_KRB5_RENEWABLE_LIFETIME);
+ if (lifetime_str == NULL) {
+ DEBUG(7, ("Cannot read [%s] from environment.\n",
+ SSSD_KRB5_RENEWABLE_LIFETIME));
+ } else {
+ kerr = krb5_string_to_deltat(lifetime_str, &lifetime);
+ if (kerr != 0) {
+ DEBUG(1, ("krb5_string_to_deltat failed for [%s].\n",
+ lifetime_str));
+ KRB5_DEBUG(1, kerr);
+ goto failed;
+ }
+ krb5_get_init_creds_opt_set_renew_life(kr->options, lifetime);
+ }
+
/* TODO: set options, e.g.
* krb5_get_init_creds_opt_set_tkt_life
- * krb5_get_init_creds_opt_set_renew_life
* krb5_get_init_creds_opt_set_forwardable
* krb5_get_init_creds_opt_set_proxiable
* krb5_get_init_creds_opt_set_etype_list