[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

rpms/util-linux/devel util-linux-2.13-login-timeval.patch, NONE, 1.1 util-linux.spec, 1.135, 1.136



Author: kzak

Update of /cvs/dist/rpms/util-linux/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv19299

Modified Files:
	util-linux.spec 
Added Files:
	util-linux-2.13-login-timeval.patch 
Log Message:
add timeval patch

util-linux-2.13-login-timeval.patch:
 login.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

--- NEW FILE util-linux-2.13-login-timeval.patch ---

On 64-bit platforms such as x86_64, glibc is usally built with 32-bit
compatibilty for various structures. One of them is utmp.

What this means is that gettimeofday(&ut.ut_tv, NULL) on x86_64 will
end up overwriting the first parts of ut_addr_v6, leading to garbage
in the utmp file.


--- util-linux-2.13-pre6/login-utils/login.c.kzak	2006-08-10 11:38:33.000000000 +0200
+++ util-linux-2.13-pre6/login-utils/login.c	2006-08-10 11:38:49.000000000 +0200
@@ -257,6 +257,7 @@
 static void
 logbtmp(const char *line, const char *username, const char *hostname) {
 	struct utmp ut;
+	struct timeval tv;
 
 	memset(&ut, 0, sizeof(ut));
 
@@ -267,7 +268,9 @@
 	xstrncpy(ut.ut_line, line, sizeof(ut.ut_line));
 
 #if defined(_HAVE_UT_TV)	    /* in <utmpbits.h> included by <utmp.h> */
-	gettimeofday(&ut.ut_tv, NULL);
+	gettimeofday(&tv, NULL);
+	ut.ut_tv.tv_sec = tv.tv_sec;
+	ut.ut_tv.tv_usec = tv.tv_usec;
 #else
 	{
 		time_t t;
@@ -872,6 +875,7 @@
     {
 	struct utmp ut;
 	struct utmp *utp;
+	struct timeval tv;
 	
 	utmpname(_PATH_UTMP);
 	setutent();
@@ -911,7 +915,9 @@
 	strncpy(ut.ut_user, username, sizeof(ut.ut_user));
 	xstrncpy(ut.ut_line, tty_name, sizeof(ut.ut_line));
 #ifdef _HAVE_UT_TV		/* in <utmpbits.h> included by <utmp.h> */
-	gettimeofday(&ut.ut_tv, NULL);
+	gettimeofday(&tv, NULL);
+	ut.ut_tv.tv_sec = tv.tv_sec;
+	ut.ut_tv.tv_usec = tv.tv_usec;
 #else
 	{
 	    time_t t;


Index: util-linux.spec
===================================================================
RCS file: /cvs/dist/rpms/util-linux/devel/util-linux.spec,v
retrieving revision 1.135
retrieving revision 1.136
diff -u -r1.135 -r1.136
--- util-linux.spec	27 Jul 2006 22:31:19 -0000	1.135
+++ util-linux.spec	10 Aug 2006 10:20:54 -0000	1.136
@@ -9,7 +9,7 @@
 Summary: A collection of basic system utilities.
 Name: util-linux
 Version: 2.13
-Release: 0.36
+Release: 0.37
 License: distributable
 Group: System Environment/Base
 
@@ -222,6 +222,8 @@
 Patch245: util-linux-2.13-login-ipv6.patch
 # fscache bits for NFS mounts
 Patch246: util-linux-2.13-nfsmount-fsc.patch
+# 176494 - last -i returns strange IP addresses
+Patch247: util-linux-2.13-login-timeval.patch
 
 # When adding patches, please make sure that it is easy to find out what bug # the 
 # patch fixes.
@@ -319,6 +321,7 @@
 %patch244 -p1
 %patch245 -p1
 %patch246 -p1
+%patch247 -p1
 
 %build
 unset LINGUAS || :
@@ -716,6 +719,9 @@
 /sbin/losetup
 
 %changelog
+* Thu Aug 10 2006 Karel Zak <kzak redhat com> 2.13-0.37
+- fix #176494 - last -i returns strange IP addresses (patch by Bill Nottingham)
+
 * Thu Jul 27 2006 Karel Zak <kzak redhat com> 2.13-0.36
 - fix #198300, #199557 - util-linux "post" scriptlet failure
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]