svn commit: r201677 - user/ed/utmpx/lib/libc/gen

Ed Schouten ed at FreeBSD.org
Wed Jan 6 21:27:06 UTC 2010


Author: ed
Date: Wed Jan  6 21:27:06 2010
New Revision: 201677
URL: http://svn.freebsd.org/changeset/base/201677

Log:
  Respect the byte ordering of fu_tv.

Modified:
  user/ed/utmpx/lib/libc/gen/pututxline.c

Modified: user/ed/utmpx/lib/libc/gen/pututxline.c
==============================================================================
--- user/ed/utmpx/lib/libc/gen/pututxline.c	Wed Jan  6 21:22:29 2010	(r201676)
+++ user/ed/utmpx/lib/libc/gen/pututxline.c	Wed Jan  6 21:27:06 2010	(r201677)
@@ -163,7 +163,7 @@ utx_active_remove(struct futx *fu)
 			 * Prevent login sessions from having a negative
 			 * timespan.
 			 */
-			if (fu->fu_tv < fe.fu_tv)
+			if (be64toh(fu->fu_tv) < be64toh(fe.fu_tv))
 				fu->fu_tv = fe.fu_tv;
 
 			/* Terminate session. */
@@ -203,7 +203,7 @@ utx_lastlogin_add(const struct futx *fu)
 			continue;
 
 		/* Prevent lowering the time value. */
-		if (fu->fu_tv <= fe.fu_tv)
+		if (be64toh(fu->fu_tv) <= be64toh(fe.fu_tv))
 			goto done;
 		
 		/* Found a previous lastlogin entry for this user. */


More information about the svn-src-user mailing list