The only remaining chunk of 419_time_structures.dpatch was coming from

008_login_log_failure_in_FTMP.
Fix 008_login_log_failure_in_FTMP, and remove 419_time_structures.dpatch
This commit is contained in:
nekral-guest
2008-01-04 20:28:51 +00:00
parent 17026efc75
commit e3e826734c
4 changed files with 17 additions and 50 deletions
+5 -2
View File
@@ -32,8 +32,11 @@ shadow (1:4.1.0-1) UNRELEASED; urgency=low
-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 from
CFLAGS.
- 479_chowntty_debug was debian specific. Renamed to 579_chowntty_debug
- Reapply 419_time_structures.dpatch. Remove teh parts which are already
fixed upstream (not necessarily the same way).
- Remove (not applied patch) 419_time_structures.dpatch. All its chunks
are already applied upstream (with some differences), except one chunk
which comes from 008_login_log_failure_in_FTMP. Fix
008_login_log_failure_in_FTMP. This should fix some bugs causing invalid
faillog entries on 64 bit architectures with 32 bit compatibility.
-- Nicolas FRANCOIS (Nekral) <nicolas.francois@centraliens.net> Sat, 17 Nov 2007 18:33:26 +0100
+12 -3
View File
@@ -8,17 +8,26 @@ Index: shadow-4.0.18.1/src/login.c
===================================================================
--- shadow-4.0.18.1.orig/src/login.c 2006-09-17 12:17:54.336008314 +0200
+++ shadow-4.0.18.1/src/login.c 2006-09-17 12:17:54.972013371 +0200
@@ -716,6 +716,20 @@
@@ -716,6 +716,29 @@
#endif /* WITH_AUDIT */
fprintf(stderr,"\nLogin incorrect\n");
+ if (getdef_str("FTMP_FILE") != NULL) {
+#if HAVE_UTMPX_H
+ failent = utxent;
+ gettimeofday(&(failent.ut_tv), NULL);
+ if (sizeof (failent.ut_tv) == sizeof (struct timeval))
+ gettimeofday((struct timeval *)
+ &failent.ut_tv, NULL);
+ else {
+ 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(NULL);
+#endif
+ strncpy(failent.ut_user, failent_user, sizeof(failent.ut_user));
+#ifdef USER_PROCESS
-44
View File
@@ -1,44 +0,0 @@
#! /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
-1
View File
@@ -6,7 +6,6 @@
434_login_stop_checking_args_after--
008_login_log_failure_in_FTMP
429_login_FAILLOG_ENAB
419_time_structures.dpatch
401_cppw_src.dpatch
504_undef_USE_PAM.dpatch
504_undef_USE_PAM.nolibpam