* ccache.c (printtime): Do not assume that krb5_timestamp and
authorEzra Peisach <epeisach@mit.edu>
Fri, 21 Jun 2002 19:31:55 +0000 (19:31 +0000)
committerEzra Peisach <epeisach@mit.edu>
Fri, 21 Jun 2002 19:31:55 +0000 (19:31 +0000)
time_t are the same size as an argument to localtime.

* heuristic.c (get_authorized_princ_names): If .k5login file
exists but is not owned by the user, do not attempt to fclose an
uninitialized FILE *.

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

src/clients/ksu/ChangeLog
src/clients/ksu/ccache.c
src/clients/ksu/heuristic.c

index 57fc7fd264e36ae2d6ec5f19e71d0162f6a90007..d905da262ccbbe747df7e0a31dc6c462c2d7478b 100644 (file)
@@ -1,3 +1,12 @@
+2002-06-21  Ezra Peisach  <epeisach@bu.edu>
+
+       * ccache.c (printtime): Do not assume that krb5_timestamp and
+       time_t are the same size as an argument to localtime.
+
+       * heuristic.c (get_authorized_princ_names): If .k5login file
+       exists but is not owned by the user, do not attempt to fclose an
+       uninitialized FILE *.
+
 2001-10-30  Ezra Peisach  <epeisach@mit.edu>
 
        * main.c (main): Do not pass LOG_AUTH facility into openlog() as a
index 62d76aa87a121725fc1f9e341dd2ff015035618f..5e9c5ec511dae1f84f0e909d1ada3882f20366ce 100644 (file)
@@ -346,13 +346,15 @@ char *flags_string(cred)
 void printtime(tv)
     time_t tv;
 {
-    struct tm *kstime;
     char fmtbuf[18];
     char fill;
+    krb5_timestamp tstamp;
 
-    kstime = localtime((time_t *)&tv);
+    /* XXXX ASSUMES sizeof(krb5_timestamp) >= sizeof(time_t) */
+    (void) localtime((time_t *)&tv);
+    tstamp = tv;
     fill = ' ';
-    if (!krb5_timestamp_to_sfstring((krb5_timestamp) tv,
+    if (!krb5_timestamp_to_sfstring(tstamp,
                                    fmtbuf,
                                    sizeof(fmtbuf),
                                    &fill))
index c17496bf4bcafbdcb48c7eb99fe0be8b39e68f93..a17ef28457f08f2dbd088c21a751dd46c2fdba9b 100644 (file)
@@ -224,7 +224,8 @@ get_authorized_princ_names(luser, cmd, princ_list)
         if ((login_fp = fopen(k5login_path, "r")) == NULL)
            return 0;
         if ( fowner(login_fp, pwd->pw_uid) == FALSE){
-           close_time(k5users_flag,users_fp, k5login_flag,login_fp);
+           close_time(1 /*k5users_flag*/, (FILE *) 0 /*users_fp*/, 
+                      k5login_flag,login_fp);
            return 0;
         }
     }