Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/crypto/external/bsd/heimdal/dist/kuser - factor out common code



details:   https://anonhg.NetBSD.org/src/rev/6b4f4a8f804c
branches:  trunk
changeset: 460372:6b4f4a8f804c
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Oct 19 15:55:50 2019 +0000

description:
- factor out common code
- use llabs because time_t can be long long.

diffstat:

 crypto/external/bsd/heimdal/dist/kuser/kinit.c |  14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diffs (34 lines):

diff -r 7851db537705 -r 6b4f4a8f804c crypto/external/bsd/heimdal/dist/kuser/kinit.c
--- a/crypto/external/bsd/heimdal/dist/kuser/kinit.c    Sat Oct 19 15:48:48 2019 +0000
+++ b/crypto/external/bsd/heimdal/dist/kuser/kinit.c    Sat Oct 19 15:55:50 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kinit.c,v 1.2 2017/01/28 21:31:45 christos Exp $       */
+/*     $NetBSD: kinit.c,v 1.3 2019/10/19 15:55:50 christos Exp $       */
 
 /*
  * Copyright (c) 1997-2007 Kungliga Tekniska Högskolan
@@ -711,18 +711,18 @@
     }
 
     if (ticket_life != 0) {
-       if (labs(cred.times.endtime - cred.times.starttime - ticket_life) > 30) {
+       krb5_deltat d = cred.times.endtime - cred.times.starttime;
+       if (llabs(d - ticket_life) > 30) {
            char life[64];
-           unparse_time_approx(cred.times.endtime - cred.times.starttime,
-                               life, sizeof(life));
+           unparse_time_approx(d, life, sizeof(life));
            krb5_warnx(context, N_("NOTICE: ticket lifetime is %s", ""), life);
        }
     }
     if (renew_life) {
-       if (labs(cred.times.renew_till - cred.times.starttime - renew) > 30) {
+       krb5_deltat d = cred.times.renew_till - cred.times.starttime;
+       if (llabs(d - renew) > 30) {
            char life[64];
-           unparse_time_approx(cred.times.renew_till - cred.times.starttime,
-                               life, sizeof(life));
+           unparse_time_approx(d, life, sizeof(life));
            krb5_warnx(context,
                       N_("NOTICE: ticket renewable lifetime is %s", ""),
                       life);



Home | Main Index | Thread Index | Old Index