Files
shadow/debian/patches/419_time_structures.dpatch
nekral-guest 17026efc75 I finally reviewed 419_time_structures.dpatch, and it needs to be applied.
One chunk was not applied upstream.
2008-01-04 19:59:42 +00:00

45 lines
1.6 KiB
Plaintext
Executable File

#! /bin/sh /usr/share/dpatch/dpatch-run
## 319_time_structures.dpatch by Nicolas FRANCOIS <nicolas.francois@centraliens.net>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: I didn't find a related bug in the BTS.
## DP: It must be related to the 1:4.0.3-22 changelog:
## DP: Don't assume that lastlog.ll_time or utmp.ut_time or utmpx.ut_tv are
## DP: made up of time_ts and timevals, because they aren't on x86-64.
## DP: Dismaying but true.
## DP: -- Karl Ramm <kcr@debian.org> Sun, 14 Mar 2004
## DP:
## DP: Some parts of this patch have been applied upstream. The other parts
## DP: should be checked.
## DP:
## DP: With the Glibc, with __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32,
## DP: ut_time (i.e. ut_tv.tv_sec) is not a time_t but an int32 (ditto for
## DP: ll_time)
@DPATCH@
Index: shadow-4.1.0/src/login.c
===================================================================
--- shadow-4.1.0.orig/src/login.c 2008-01-03 23:00:48.872001845 +0100
+++ shadow-4.1.0/src/login.c 2008-01-03 23:15:56.012001027 +0100
@@ -736,10 +736,18 @@
if (getdef_str("FTMP_FILE") != NULL) {
#if HAVE_UTMPX_H
failent = utxent;
- gettimeofday(&(failent.ut_tv), NULL);
+ /* don't assume that utmpx.ut_tv is a struct
+ timeval */
+ {
+ struct timeval tv;
+
+ gettimeofday(&tv, NULL);
+ failent.ut_tv.tv_sec = tv.tv_sec;
+ failent.ut_tv.tv_usec = tv.tv_usec;
+ }
#else
failent = utent;
- time(&failent.ut_time);
+ failent.ut_time = time(0);
#endif
strncpy(failent.ut_user, failent_user, sizeof(failent.ut_user));
#ifdef USER_PROCESS