diff options
-rw-r--r-- | loginrec.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/loginrec.c b/loginrec.c index 5951e0271..00136a952 100644 --- a/loginrec.c +++ b/loginrec.c | |||
@@ -170,7 +170,7 @@ | |||
170 | #include "xmalloc.h" | 170 | #include "xmalloc.h" |
171 | #include "loginrec.h" | 171 | #include "loginrec.h" |
172 | 172 | ||
173 | RCSID("$Id: loginrec.c,v 1.4 2000/06/07 11:32:13 djm Exp $"); | 173 | RCSID("$Id: loginrec.c,v 1.5 2000/06/12 22:21:44 andre Exp $"); |
174 | 174 | ||
175 | /** | 175 | /** |
176 | ** prototypes for helper functions in this file | 176 | ** prototypes for helper functions in this file |
@@ -372,29 +372,40 @@ getlast_entry(struct logininfo *li) | |||
372 | #else | 372 | #else |
373 | /* !USE_LASTLOG */ | 373 | /* !USE_LASTLOG */ |
374 | 374 | ||
375 | # ifdef DISABLE_LASTLOG | ||
376 | /* On some systems we shouldn't even try to obtain last login | ||
377 | * time, e.g. AIX */ | ||
378 | return 0; | ||
379 | |||
380 | # else | ||
375 | /* Try to retrieve the last login time from wtmp */ | 381 | /* Try to retrieve the last login time from wtmp */ |
376 | # if defined(USE_WTMP) && (defined(HAVE_TIME_IN_UTMP) || defined(HAVE_TV_IN_UTMP)) | 382 | # if defined(USE_WTMP) && (defined(HAVE_TIME_IN_UTMP) || defined(HAVE_TV_IN_UTMP)) |
377 | /* retrieve last login time from utmp */ | 383 | /* retrieve last login time from utmp */ |
378 | if (wtmp_get_entry(li)) | 384 | if (wtmp_get_entry(li)) |
379 | return 1; | 385 | return 1; |
380 | else | 386 | else |
381 | return 0; | 387 | return 0; |
382 | # else | 388 | # else |
383 | 389 | ||
384 | /* If wtmp isn't available, try wtmpx */ | 390 | /* If wtmp isn't available, try wtmpx */ |
385 | 391 | ||
386 | # if defined(USE_WTMPX) && (defined(HAVE_TIME_IN_UTMPX) || defined(HAVE_TV_IN_UTMPX)) | 392 | # if defined(USE_WTMPX) && (defined(HAVE_TIME_IN_UTMPX) || defined(HAVE_TV_IN_UTMPX)) |
387 | /* retrieve last login time from utmpx */ | 393 | /* retrieve last login time from utmpx */ |
388 | if (wtmpx_get_entry(li)) | 394 | if (wtmpx_get_entry(li)) |
389 | return 1; | 395 | return 1; |
390 | else | 396 | else |
391 | return 0; | 397 | return 0; |
392 | # else | 398 | # else |
393 | 399 | ||
394 | /* Give up: No means of retrieving last login time */ | 400 | /* Give up: No means of retrieving last login time */ |
395 | return 0; | 401 | return 0; |
402 | # endif | ||
403 | /* USE_WTMPX && (HAVE_TIME_IN_UTMPX || HAVE_TV_IN_UTMPX) */ | ||
404 | |||
396 | # endif | 405 | # endif |
406 | /* USE_WTMP && (HAVE_TIME_IN_UTMP || HAVE_TV_IN_UTMP) */ | ||
397 | # endif | 407 | # endif |
408 | /* DISABLE_LASTLOG */ | ||
398 | #endif | 409 | #endif |
399 | /* USE_LASTLOG */ | 410 | /* USE_LASTLOG */ |
400 | } | 411 | } |