if (code != 0)
return code;
- /* Use it to get a new credential from the KDC. */
+ /* Use KDC options from old credential as well as requested options. */
+ kdcopt |= (old_creds.ticket_flags & KDC_TKT_COMMON_MASK);
+
+ /* Use the old credential to get a new credential from the KDC. */
code = krb5_get_cred_via_tkt(context, &old_creds, kdcopt,
old_creds.addresses, in_creds, &new_creds);
krb5_free_cred_contents(context, &old_creds);
$(RUNPYTEST) $(srcdir)/t_lockout.py $(PYTESTFLAGS)
$(RUNPYTEST) $(srcdir)/t_kadm5_hook.py $(PYTESTFLAGS)
$(RUNPYTEST) $(srcdir)/t_keyrollover.py $(PYTESTFLAGS)
+ $(RUNPYTEST) $(srcdir)/t_renew.py $(PYTESTFLAGS)
clean::
$(RM) kdc.conf
--- /dev/null
+#!/usr/bin/python
+from k5test import *
+
+realm = K5Realm(create_host=False, start_kadmind=False, get_creds=False)
+
+# Configure the realm to allow renewable tickets and acquire some.
+realm.run_kadminl('modprinc -maxrenewlife "2 days" user')
+realm.run_kadminl('modprinc -maxrenewlife "2 days" %s' % realm.krbtgt_princ)
+realm.kinit(realm.user_princ, password('user'), flags=['-r', '2d'])
+
+# Renew twice, to test that renewed tickets are renewable.
+realm.kinit(realm.user_princ, flags=['-R'])
+realm.kinit(realm.user_princ, flags=['-R'])
+realm.klist(realm.user_princ)
+
+success('Renewing credentials.')