summaryrefslogtreecommitdiffstats
path: root/src/providers/krb5/krb5_child.c
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2010-11-09 13:11:52 +0100
committerStephen Gallagher <sgallagh@redhat.com>2010-12-03 10:41:28 -0500
commit1709edfb690bb4ffa4b96c64d08853f47390eda3 (patch)
treebf07e7bbe85e6ff86639153b7783d4ed750760ac /src/providers/krb5/krb5_child.c
parentd2d23847f879712d6e191134018a8bff70a5e2ab (diff)
downloadsssd-1709edfb690bb4ffa4b96c64d08853f47390eda3.tar.gz
sssd-1709edfb690bb4ffa4b96c64d08853f47390eda3.tar.xz
sssd-1709edfb690bb4ffa4b96c64d08853f47390eda3.zip
krb5_child returns TGT lifetime
Diffstat (limited to 'src/providers/krb5/krb5_child.c')
-rw-r--r--src/providers/krb5/krb5_child.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/providers/krb5/krb5_child.c b/src/providers/krb5/krb5_child.c
index f29869bc2..c12478f18 100644
--- a/src/providers/krb5/krb5_child.c
+++ b/src/providers/krb5/krb5_child.c
@@ -456,6 +456,25 @@ static errno_t sendresponse(int fd, krb5_error_code kerr, int pam_status,
return EOK;
}
+static errno_t add_ticket_times_to_response(struct krb5_req *kr)
+{
+ int ret;
+ int64_t t[4];
+
+ t[0] = (int64_t) kr->creds->times.authtime;
+ t[1] = (int64_t) kr->creds->times.starttime;
+ t[2] = (int64_t) kr->creds->times.endtime;
+ t[3] = (int64_t) kr->creds->times.renew_till;
+
+ ret = pam_add_response(kr->pd, SSS_KRB5_INFO_TGT_LIFETIME,
+ 4*sizeof(int64_t), (uint8_t *) t);
+ if (ret != EOK) {
+ DEBUG(1, ("pack_response_packet failed.\n"));
+ }
+
+ return ret;
+}
+
static krb5_error_code validate_tgt(struct krb5_req *kr)
{
krb5_error_code kerr;
@@ -595,6 +614,11 @@ static krb5_error_code get_and_save_tgt(struct krb5_req *kr,
goto done;
}
+ ret = add_ticket_times_to_response(kr);
+ if (ret != EOK) {
+ DEBUG(1, ("add_ticket_times_to_response failed.\n"));
+ }
+
kerr = 0;
done:
@@ -941,6 +965,11 @@ static errno_t renew_tgt_child(int fd, struct krb5_req *kr)
goto done;
}
+ ret = add_ticket_times_to_response(kr);
+ if (ret != EOK) {
+ DEBUG(1, ("add_ticket_times_to_response failed.\n"));
+ }
+
status = PAM_SUCCESS;
done: