Sophie

Sophie

distrib > Mandriva > 2009.0 > i586 > by-pkgid > 18e9e957d3690555fc6e7a51085fc8b1 > files > 13

krb5-1.6.3-6mdv2009.0.src.rpm

--- krb5-1.2.5/src/appl/bsd/login.c.biarch-utmp	2002-01-26 04:03:51.000000000 +0100
+++ krb5-1.2.5/src/appl/bsd/login.c	2003-04-07 12:24:31.000000000 +0200
@@ -1433,7 +1433,7 @@ int main(argc, argv)
     {
 	struct utmp utmp;
 
-	login_time = time(&utmp.ut_time);
+	login_time = utmp.ut_time = time(NULL);
 	if ((retval = pty_update_utmp(PTY_USER_PROCESS, getpid(), username,
 				      ttyn, hostname,
 				      PTY_TTYSLOT_USABLE)) < 0)
--- krb5-1.2.5/src/appl/gssftp/ftpd/logwtmp.c.biarch-utmp	1998-05-27 21:34:36.000000000 +0200
+++ krb5-1.2.5/src/appl/gssftp/ftpd/logwtmp.c	2003-04-07 13:35:17.000000000 +0200
@@ -82,7 +82,7 @@ void ftp_logwtmp(line, name, host)
 #ifndef NO_UT_HOST
 		(void)strncpy(ut.ut_host, host, sizeof(ut.ut_host));
 #endif
-		(void)time(&ut.ut_time);
+		ut.ut_time = time(NULL);
 		if (write(fd, (char *)&ut, sizeof(struct utmp)) !=
 		    sizeof(struct utmp))
 			(void)ftruncate(fd, buf.st_size);
--- krb5-1.2.5/src/appl/libpty/dump-utmp.c.biarch-utmp	2001-09-11 01:31:30.000000000 +0200
+++ krb5-1.2.5/src/appl/libpty/dump-utmp.c	2003-04-07 12:16:32.000000000 +0200
@@ -83,6 +83,7 @@ print_ut(int all, const struct utmp *u)
 #ifdef PTY_UTMP_E_EXIT
     int let, lee;
 #endif
+    time_t time;
 
 #ifdef HAVE_STRUCT_UTMP_UT_TYPE
     if (!all && ((u->ut_type == EMPTY) || (u->ut_type == DEAD_PROCESS)))
@@ -110,7 +111,8 @@ print_ut(int all, const struct utmp *u)
 #ifdef HAVE_STRUCT_UTMP_UT_TYPE
     printf(" %-9s", ut_typename(u->ut_type));
 #endif
-    printf(" %s", ctime(&u->ut_time) + 4);
+    time = u->ut_time;
+    printf(" %s", ctime(&time) + 4);
 #ifdef HAVE_STRUCT_UTMP_UT_HOST
     if (u->ut_host[0])
 	printf(" %.*s\n", (int) sizeof(u->ut_host), u->ut_host);
@@ -127,6 +129,7 @@ print_utx(int all, const struct utmpx *u
 #ifdef PTY_UTMPX_E_EXIT
     int let, lee;
 #endif
+    time_t nsec;
 
     if (!all && ((u->ut_type == EMPTY) || (u->ut_type == DEAD_PROCESS)))
 	return;
@@ -150,7 +153,8 @@ print_utx(int all, const struct utmpx *u
     printf("%*ld)", lee, (long)u->ut_exit.PTY_UTMPX_E_EXIT);
 #endif
     printf(" %-9s", ut_typename(u->ut_type));
-    printf(" %s", ctime(&u->ut_tv.tv_sec) + 4);
+    nsec = u->ut_tv.tv_sec;
+    printf(" %s", ctime(&nsec) + 4);
 #ifdef HAVE_STRUCT_UTMPX_UT_HOST
     if (u->ut_host[0])
 	printf(" %s\n", u->ut_host);
--- krb5-1.2.5/src/appl/libpty/update_utmp.c.biarch-utmp	2001-11-28 22:31:00.000000000 +0100
+++ krb5-1.2.5/src/appl/libpty/update_utmp.c	2003-04-07 12:20:15.000000000 +0200
@@ -559,10 +559,21 @@ pty_update_utmp(int process_type, int pi
 	utxtmp = best_utxent(&utx);
 
 #ifdef HAVE_SETUTXENT
-    if (gettimeofday(&utx.ut_tv, NULL))
-	return errno;
+    if (sizeof (utx.ut_tv) == sizeof (struct timeval))
+      {
+	if (gettimeofday((struct timeval *) &utx.ut_tv, NULL))
+	  return errno;
+      }
+    else
+      {
+	struct timeval tv;
+	if (gettimeofday(&tv, NULL))
+	  return errno;
+	utx.ut_tv.tv_sec = tv.tv_sec;
+	utx.ut_tv.tv_usec = tv.tv_usec;
+      }
 #else
-    (void)time(&utx.ut_time);
+    utx.ut_time = time(NULL);
 #endif
     /*
      * On what system is there not ut_host?  Unix98 doesn't mandate
@@ -655,7 +666,7 @@ pty_update_utmp(int process_type, int pi
     if (strncmp(cp, "/dev/", sizeof("/dev/") - 1) == 0)
 	cp += sizeof("/dev/") - 1;
     strncpy(ent.ut_line, cp, sizeof(ent.ut_line));
-    (void)time(&ent.ut_time);
+    ent.ut_time = time(NULL);
 
     if (flags & PTY_TTYSLOT_USABLE)
 	tty = ttyslot();
--- krb5-1.2.5/src/appl/libpty/logwtmp.c.biarch-utmp	2001-09-11 01:31:30.000000000 +0200
+++ krb5-1.2.5/src/appl/libpty/logwtmp.c	2003-04-07 12:21:36.000000000 +0200
@@ -57,9 +57,17 @@ pty_logwtmp(const char *tty, const char 
     utx.ut_host[sizeof(utx.ut_host) - 1] = '\0';
 #endif
 #ifdef HAVE_SETUTXENT
-    gettimeofday(&utx.ut_tv, NULL);
+    if (sizeof (utx.ut_tv) == sizeof (struct timeval))
+      gettimeofday((struct timeval *) &utx.ut_tv, NULL);
+    else
+      {
+	struct timeval tv;
+	gettimeofday(&tv, NULL);
+	utx.ut_tv.tv_sec = tv.tv_sec;
+	utx.ut_tv.tv_usec = tv.tv_usec;
+      }
 #else
-    (void)time(&utx.ut_time);
+    utx.ut_time = time(NULL);
 #endif
     utx.ut_pid = (loggingin ? getpid() : 0);
     utx.ut_type = (loggingin ? USER_PROCESS : DEAD_PROCESS);