a) set the INITIAL flag on all AS_ tickets
authorJohn Kohl <jtkohl@mit.edu>
Mon, 29 Apr 1991 14:25:58 +0000 (14:25 +0000)
committerJohn Kohl <jtkohl@mit.edu>
Mon, 29 Apr 1991 14:25:58 +0000 (14:25 +0000)
b) clean up min() function to be more readable

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@2052 dc483132-0cff-0310-8789-dd5450dbe970

src/kdc/do_as_req.c

index e0a34d757516b7acb3e802d0662a9a4c09196f00..ce779bec97507277f82603702a79ff10d25674da 100644 (file)
@@ -160,6 +160,7 @@ krb5_data **response;                       /* filled in with a response packet */
     ticket_reply.enc_part.kvno = server.kvno;
 
     enc_tkt_reply.flags = 0;
+    setflag(enc_tkt_reply.flags, TKT_FLG_INITIAL);
 
         /* It should be noted that local policy may affect the  */
         /* processing of any of these flags.  For example, some */
@@ -217,14 +218,14 @@ krb5_data **response;                     /* filled in with a response packet */
     }
     rtime = (request->rtime == 0) ? kdc_infinity : request->rtime;
 
+    /* should we squelch the output renew_till to be no earlier
+       than the endtime of the ticket? XXX */
     if (isflagset(request->kdc_options, KDC_OPT_RENEWABLE)) {
        setflag(enc_tkt_reply.flags, TKT_FLG_RENEWABLE);
        enc_tkt_reply.times.renew_till =
-           min(rtime, min(enc_tkt_reply.times.starttime +
-                          client.max_renewable_life,
-                          min(enc_tkt_reply.times.starttime +
-                              server.max_renewable_life,
-                              enc_tkt_reply.times.starttime +
+           min(rtime, enc_tkt_reply.times.starttime +
+                      min(client.max_renewable_life,
+                          min(server.max_renewable_life,
                               max_renewable_life_for_realm)));
     } else
        enc_tkt_reply.times.renew_till = 0; /* XXX */