faillog, lastlog

Steve Crosby fost at hotmail.com
Thu Dec 16 01:11:48 PST 2004


John Harrigan <harriganj at adelphia.net> wrote in 
news:20041216052945.GA15362 at melrose:

> I built an LFS-6.0 system and I've noticed that faillog and lastlog
> aren't quite working.  I selected both of them in /etc/login.defs
> but only lastlog is accumulating data; faillog doesn't even exist.
> 
> lastlog seems to be accumulating the correct data about the location
> of the last login, but it's not recording any login times.  Here is
> an example:
> 
> Username         Port     From             Latest
> root             tty2                      **Never logged in**
> nobody                                     **Never logged in**
> 
> 'who' on the other hand, shows the correct login time.
> 

There is a patch in the patches project for fixing this - doesn't appear 
to have been applied upstream, and I haven't tested it myself.

patch details below (applies to shadow-4.0.6 without error)

=============================
Submitted By: Kristian Rainio (krikesoft at suomi24.fi)
Date: 2004-09-13
Initial Package Version: 4.0.4.1
Origin: NA
Upstream Status: Not submitted
Description: This fixes lastlog brokenness in my case. I use glibc-2.3.2
 
diff -Naur shadow-4.0.4.1.orig/libmisc/log.c shadow-4.0.4.1/libmisc/log.c
--- shadow-4.0.4.1.orig/libmisc/log.c	2003-12-17 12:52:25.000000000 +
0000
+++ shadow-4.0.4.1/libmisc/log.c	2004-09-13 10:46:21.356307376 +0000
@@ -55,7 +55,6 @@
 	int fd;
 	off_t offset;
 	struct lastlog newlog;
-	time_t ll_time;
 
 	/*
 	 * If the file does not exist, don't create it.
@@ -87,8 +86,7 @@
 	if (ll)
 		*ll = newlog;
 
-	ll_time = newlog.ll_time;
-	time (&ll_time);
+	time (&newlog.ll_time);
 	strncpy (newlog.ll_line, line, sizeof newlog.ll_line);
 #if HAVE_LL_HOST
 	strncpy (newlog.ll_host, host, sizeof newlog.ll_host);

==============================

- --
Steve Crosby



More information about the lfs-support mailing list