loginrec.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* Copyright 2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Copyright (c) 2000 Andre Lucas. All rights reserved.
* Portions copyright (c) 1998 Todd C. Miller
* Portions copyright (c) 1996 Jason Downs
* Portions copyright (c) 1996 Theo de Raadt
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Markus Friedl.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
** loginrec.c: platform-independent login recording and lastlog retrieval
**/
/*
The new login code explained
============================
This code attempts to provide a common interface to login recording
(utmp and friends) and last login time retrieval.
Its primary means of achieving this is to use 'struct logininfo', a
union of all the useful fields in the various different types of
system login record structures one finds on UNIX variants.
We depend on autoconf to define which recording methods are to be
used, and which fields are contained in the relevant data structures
on the local system. Many C preprocessor symbols affect which code
gets compiled here.
The code is designed to make it easy to modify a particular
recording method, without affecting other methods nor requiring so
many nested conditional compilation blocks as were commonplace in
the old code.
For login recording, we try to use the local system's libraries as
these are clearly most likely to work correctly. For utmp systems
this usually means login() and logout() or setutent() etc., probably
in libutil, along with logwtmp() etc. On these systems, we fall back
to writing the files directly if we have to, though this method
requires very thorough testing so we do not corrupt local auditing
information. These files and their access methods are very system
specific indeed.
For utmpx systems, the corresponding library functions are
setutxent() etc. To the author's knowledge, all utmpx systems have
these library functions and so no direct write is attempted. If such
a system exists and needs support, direct analogues of the [uw]tmp
code should suffice.
Retrieving the time of last login ('lastlog') is in some ways even
more problemmatic than login recording. Some systems provide a
simple table of all users which we seek based on uid and retrieve a
relatively standard structure. Others record the same information in
a directory with a separate file, and others don't record the
information separately at all. For systems in the latter category,
we look backwards in the wtmp or wtmpx file for the last login entry
for our user. Naturally this is slower and on busy systems could
incur a significant performance penalty.
Calling the new code
--------------------
In OpenSSH all login recording and retrieval is performed in
login.c. Here you'll find working examples. Also, in the logintest.c
program there are more examples.
Internal handler calling method
-------------------------------
When a call is made to login_login() or login_logout(), both
routines set a struct logininfo flag defining which action (log in,
or log out) is to be taken. They both then call login_write(), which
calls whichever of the many structure-specific handlers autoconf
selects for the local system.
The handlers themselves handle system data structure specifics. Both
struct utmp and struct utmpx have utility functions (see
construct_utmp*()) to try to make it simpler to add extra systems
that introduce new features to either structure.
While it may seem terribly wasteful to replicate so much similar
code for each method, experience has shown that maintaining code to
write both struct utmp and utmpx in one function, whilst maintaining
support for all systems whether they have library support or not, is
a difficult and time-consuming task.
Lastlog support proceeds similarly. Functions login_get_lastlog()
(and its OpenSSH-tuned friend login_get_lastlog_time()) call
getlast_entry(), which tries one of three methods to find the last
login time. It uses local system lastlog support if it can,
otherwise it tries wtmp or wtmpx before giving up and returning 0,
meaning "tilt".
Maintenance
-----------
In many cases it's possible to tweak autoconf to select the correct
methods for a particular platform, either by improving the detection
code (best), or by presetting DISABLE_<method> or CONF_<method>_FILE
symbols for the platform.
Use logintest to check which symbols are defined before modifying
configure.ac and loginrec.c. (You have to build logintest yourself
with 'make logintest' as it's not built by default.)
Otherwise, patches to the specific method(s) are very helpful!
*/
/**
** TODO:
** homegrown ttyslot()
** test, test, test
**
** Platform status:
** ----------------
**
** Known good:
** Linux (Redhat 6.2, Debian)
** Solaris
** HP-UX 10.20 (gcc only)
** IRIX
**
** Testing required: Please send reports!
** NetBSD
** HP-UX 11
** AIX
**
** Platforms with known problems:
** Some variants of Slackware Linux
**
**/
#include "includes.h"
#include "ssh.h"
#include "xmalloc.h"
#include "loginrec.h"
#include "log.h"
#include "atomicio.h"
RCSID("$Id: loginrec.c,v 1.44 2002/09/26 00:38:49 tim Exp $");
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef HAVE_UTIL_H
# include <util.h>
#endif
#ifdef HAVE_LIBUTIL_H
# include <libutil.h>
#endif
/**
** prototypes for helper functions in this file
**/
#if HAVE_UTMP_H
#endif
#ifdef HAVE_UTMPX_H
#endif
/* pick the shortest string */
/**
** platform-independent login functions
**/
/* login_login(struct logininfo *) -Record a login
*
* Call with a pointer to a struct logininfo initialised with
* login_init_entry() or login_alloc_entry()
*
* Returns:
* >0 if successful
* 0 on failure (will use OpenSSH's logging facilities for diagnostics)
*/
int
{
return login_write(li);
}
/* login_logout(struct logininfo *) - Record a logout
*
* Call as with login_login()
*
* Returns:
* >0 if successful
* 0 on failure (will use OpenSSH's logging facilities for diagnostics)
*/
int
{
return login_write(li);
}
/* login_get_lastlog_time(int) - Retrieve the last login time
*
* Retrieve the last login time for the given uid. Will try to use the
* system lastlog facilities if they are available, but will fall back
*
* Returns:
* 0 on failure, or if user has never logged in
* Time in seconds from the epoch if successful
*
* Useful preprocessor symbols:
* DISABLE_LASTLOG: If set, *never* even try to retrieve lastlog
* info
* USE_LASTLOG: If set, indicates the presence of system lastlog
* facilities. If this and DISABLE_LASTLOG are not set,
*/
#if 0
unsigned int
login_get_lastlog_time(const int uid)
{
else
return 0;
}
#endif
/* login_get_lastlog(struct logininfo *, int) - Retrieve a lastlog entry
*
* Retrieve a logininfo structure populated (only partially) with
* system lastlog information exists.
*
* Note this routine must be given a pre-allocated logininfo.
*
* Returns:
* >0: A pointer to your struct logininfo if successful
* 0 on failure (will use OpenSSH's logging facilities for diagnostics)
*
*/
struct logininfo *
{
/*
* If we don't have a 'real' lastlog, we need the username to
* reliably search wtmp(x) for the last login (see
* wtmp_get_entry().)
*/
/* No MIN_SIZEOF here - we absolutely *must not* truncate the
* username */
if (getlast_entry(li))
return li;
else
return NULL;
}
/* login_alloc_entry() - Allocate and initialise a logininfo
* structure
*
* This function creates a new struct logininfo, a data structure
* meant to carry the information required to portably record login info.
*
* Returns a pointer to a newly created struct logininfo. If memory
* allocation fails, the program halts.
*/
struct
const char *progname)
{
return newli;
}
/* login_free_entry(struct logininfo *) - free struct memory */
void
{
}
/* login_init_entry()
* - initialise a struct logininfo
*
* Populates a new struct logininfo, a data structure meant to carry
* the information required to portably record login info.
*
* Returns: 1
*/
int
{
/* set the line information */
if (line)
else
if (progname)
else
if (username) {
}
if (hostname)
return 1;
}
/* login_set_current_time(struct logininfo *) - set the current time
*
* Set the current time in a logininfo structure. This function is
* meant to eliminate the need to deal with system dependencies for
* time handling.
*/
void
{
}
/* copy a sockaddr_* into our logininfo */
void
const unsigned int sa_size)
{
/* make sure we don't overrun our union */
}
/**
** login_write: Call low-level recording functions based on autoconf
** results
**/
int
{
#ifndef HAVE_CYGWIN
if ((int)geteuid() != 0) {
log("Attempt to write login records by non-root user (aborting)");
return 1;
}
#endif
/* set the timestamp */
#ifdef USE_LOGIN
#endif
#ifdef USE_LASTLOG
(void) lastlog_write_entry(li);
}
#endif
#ifdef USE_UTMP
#endif
#ifdef USE_WTMP
#endif
#ifdef USE_UTMPX
(void) utmpx_write_entry(li);
#endif
#ifdef USE_WTMPX
(void) wtmpx_write_entry(li);
#endif
return 0;
}
#ifdef LOGIN_NEEDS_UTMPX
int
{
# ifdef USE_UTMP
# endif
# ifdef USE_WTMP
# endif
# ifdef USE_UTMPX
(void) utmpx_write_entry(li);
# endif
# ifdef USE_WTMPX
(void) wtmpx_write_entry(li);
# endif
return 0;
}
#endif
/**
** getlast_entry: Call low-level functions to retrieve the last login
** time.
**/
/* take the uid in li and return the last login time */
int
{
#ifdef USE_LASTLOG
return(lastlog_get_entry(li));
#else /* !USE_LASTLOG */
#ifdef DISABLE_LASTLOG
/* On some systems we shouldn't even try to obtain last login
* time, e.g. AIX */
return 0;
# else /* DISABLE_LASTLOG */
/* Try to retrieve the last login time from wtmp */
/* retrieve last login time from utmp */
return (wtmp_get_entry(li));
# else /* defined(USE_WTMP) && (defined(HAVE_TIME_IN_UTMP) || defined(HAVE_TV_IN_UTMP)) */
/* If wtmp isn't available, try wtmpx */
/* retrieve last login time from utmpx */
return (wtmpx_get_entry(li));
# else
/* Give up: No means of retrieving last login time */
return 0;
# endif /* USE_WTMPX && (HAVE_TIME_IN_UTMPX || HAVE_TV_IN_UTMPX) */
# endif /* USE_WTMP && (HAVE_TIME_IN_UTMP || HAVE_TV_IN_UTMP) */
# endif /* DISABLE_LASTLOG */
#endif /* USE_LASTLOG */
}
/*
* 'line' string utility functions
*
* These functions process the 'line' string into one of three forms:
*
* 1. The full filename (including '/dev')
* 2. The stripped name (excluding '/dev')
*
* Form 3 is used on some systems to identify a .tmp.? entry when
* attempting to remove it. Typically both addition and removal is
* performed by one application - say, sshd - so as long as the choice
* uniquely identifies a terminal it's ok.
*/
/* line_fullname(): add the leading '/dev/' if it doesn't exist make
* sure dst has enough space, if not just copy src (ugh) */
char *
{
/* "sshd" is special, like "ftp" */
} else {
}
return dst;
}
/* line_stripname(): strip the leading '/dev' if it exists, return dst */
char *
{
else
return dst;
}
/* line_abbrevname(): Return the abbreviated (usually four-character)
* form of the line (Just use the last <dstsize> characters of the
* full name.)
*
* NOTE: use strncpy because we do NOT necessarily want zero
* termination */
char *
{
/* Always skip prefix if present */
src += 5;
#ifdef WITH_ABBREV_NO_TTY
src += 3;
#endif
if (len > 0) {
/* note: _don't_ change this to strlcpy */
}
return dst;
}
/**
** utmp utility functions
**
** These functions manipulate struct utmp, taking system differences
** into account.
**/
/* build the utmp structure */
void
{
# ifdef HAVE_TV_IN_UTMP
# else
# ifdef HAVE_TIME_IN_UTMP
# endif
# endif
}
void
{
/* First fill out fields used for both logins and logouts */
# ifdef HAVE_ID_IN_UTMP
# endif
# ifdef HAVE_TYPE_IN_UTMP
/* This is done here to keep utmp constants out of struct logininfo */
case LTYPE_LOGIN:
#ifdef _UNICOS
#endif
break;
case LTYPE_LOGOUT:
#ifdef _UNICOS
#endif
break;
}
# endif
# ifdef HAVE_PID_IN_UTMP
# endif
/* If we're logging out, leave all other fields blank */
return;
/*
* These fields are only used when logging in, and are blank
* for logouts.
*/
/* Use strncpy because we don't necessarily want null termination */
# ifdef HAVE_HOST_IN_UTMP
# endif
# ifdef HAVE_ADDR_IN_UTMP
/* this is just a 32-bit IP address */
# endif
}
#endif /* USE_UTMP || USE_WTMP || USE_LOGIN */
/**
** utmpx utility functions
**
** These functions manipulate struct utmpx, accounting for system
** variations.
**/
/* build the utmpx structure */
void
{
# ifdef HAVE_TV_IN_UTMPX
# else /* HAVE_TV_IN_UTMPX */
# ifdef HAVE_TIME_IN_UTMPX
# endif /* HAVE_TIME_IN_UTMPX */
# endif /* HAVE_TV_IN_UTMPX */
}
void
{
# ifdef HAVE_ID_IN_UTMPX
# endif
/* this is done here to keep utmp constants out of loginrec.h */
case LTYPE_LOGIN:
break;
case LTYPE_LOGOUT:
break;
}
else if (!li->progname_null)
/* strncpy(): Don't necessarily want null termination */
return;
/*
* These fields are only used when logging in, and are blank
* for logouts.
*/
# ifdef HAVE_HOST_IN_UTMPX
# endif
# ifdef HAVE_ADDR_IN_UTMPX
/* this is just a 32-bit IP address */
# endif
# ifdef HAVE_SYSLEN_IN_UTMPX
/* ut_syslen is the length of the utx_host string */
# endif
}
#endif /* USE_UTMPX || USE_WTMPX */
/**
** Low-level utmp functions
**/
/* FIXME: (ATL) utmp_write_direct needs testing */
#ifdef USE_UTMP
/* if we can, use pututline() etc. */
# if !defined(DISABLE_PUTUTLINE) && defined(HAVE_SETUTENT) && \
defined(HAVE_PUTUTLINE)
# define UTMP_USE_LIBRARY
# endif
/* write a utmp entry with the system's help (pututline() and pals) */
# ifdef UTMP_USE_LIBRARY
static int
{
setutent();
# ifdef HAVE_ENDUTENT
endutent();
# endif
return 1;
}
# else /* UTMP_USE_LIBRARY */
/* write a utmp entry direct to the file */
/* This is a slightly modification of code in OpenBSD's login.c */
static int
{
register int fd;
int tty;
/* FIXME: (ATL) ttyslot() needs local implementation */
#if defined(HAVE_GETTTYENT)
tty=0;
setttyent();
tty++;
break;
}
endttyent();
log("utmp_write_entry: tty not found");
return(1);
}
#else /* FIXME */
#endif /* HAVE_GETTTYENT */
/*
* Prevent luser from zero'ing out ut_host.
* If the new ut_line is empty but the old one is not
* and ut_line and ut_name match, preserve the old ut_line.
*/
}
log("utmp_write_direct: error writing %s: %s",
return 1;
} else {
return 0;
}
}
# endif /* UTMP_USE_LIBRARY */
static int
{
# ifdef UTMP_USE_LIBRARY
log("utmp_perform_login: utmp_write_library() failed");
return 0;
}
# else
log("utmp_perform_login: utmp_write_direct() failed");
return 0;
}
# endif
return 1;
}
static int
{
# ifdef UTMP_USE_LIBRARY
log("utmp_perform_logout: utmp_write_library() failed");
return 0;
}
# else
log("utmp_perform_logout: utmp_write_direct() failed");
return 0;
}
# endif
return 1;
}
int
{
debug3("not writing utmp entry");
return 1;
}
debug3("writing utmp entry");
case LTYPE_LOGIN:
return utmp_perform_login(li);
case LTYPE_LOGOUT:
return utmp_perform_logout(li);
default:
log("utmp_write_entry: invalid type field");
return 0;
}
}
#endif /* USE_UTMP */
/**
** Low-level utmpx functions
**/
/* not much point if we don't want utmpx entries */
#ifdef USE_UTMPX
/* if we have the wherewithall, use pututxline etc. */
# if !defined(DISABLE_PUTUTXLINE) && defined(HAVE_SETUTXENT) && \
defined(HAVE_PUTUTXLINE)
# define UTMPX_USE_LIBRARY
# endif
/* write a utmpx entry with the system's help (pututxline() and pals) */
# ifdef UTMPX_USE_LIBRARY
static int
{
setutxent();
(void) pututxline(utx);
# ifdef HAVE_ENDUTXENT
endutxent();
# endif
return 1;
}
# else /* UTMPX_USE_LIBRARY */
/* write a utmp entry direct to the file */
static int
{
log("utmpx_write_direct: not implemented!");
return 0;
}
# endif /* UTMPX_USE_LIBRARY */
static int
{
# ifdef UTMPX_USE_LIBRARY
log("tmpx_perform_login: utmp_write_library() failed");
return 0;
}
# else
log("utmpx_perform_login: utmp_write_direct() failed");
return 0;
}
# endif
return 1;
}
static int
{
# ifdef HAVE_ID_IN_UTMPX
# endif
# ifdef HAVE_TYPE_IN_UTMPX
# endif
# ifdef UTMPX_USE_LIBRARY
# else
# endif
return 1;
}
int
{
debug3("not writing utmpx entry");
return 1;
}
debug3("writing utmpx entry");
case LTYPE_LOGIN:
return utmpx_perform_login(li);
case LTYPE_LOGOUT:
return utmpx_perform_logout(li);
default:
log("utmpx_write_entry: invalid type field");
return 0;
}
}
#endif /* USE_UTMPX */
/**
** Low-level wtmp functions
**/
#ifdef USE_WTMP
/* write a wtmp entry direct to the end of the file */
/* This is a slight modification of code in OpenBSD's logwtmp.c */
static int
{
log("wtmp_write: problem writing %s: %s",
return 0;
}
log("wtmp_write: problem writing %s: %s",
ret = 0;
}
return ret;
}
static int
{
}
static int
{
}
int
{
case LTYPE_LOGIN:
return wtmp_perform_login(li);
case LTYPE_LOGOUT:
return wtmp_perform_logout(li);
default:
log("wtmp_write_entry: invalid type field");
return 0;
}
}
*
* Logouts are usually recorded with (amongst other things) a blank
* username on a given tty line. However, some systems (HP-UX is one)
* leave all fields set, but change the ut_type field to DEAD_PROCESS.
*
* Since we're only looking for logins here, we know that the username
* must be set correctly. On systems that leave it in, we check for
* ut_type==USER_PROCESS (indicating a login.)
*
* Portability: Some systems may set something other than USER_PROCESS
* to indicate a login process. I don't know of any as I write. Also,
* it's possible that some systems may both leave the username in
* place and not have ut_type.
*/
/* return true if this wtmp entry indicates a login */
static int
{
# ifdef HAVE_TYPE_IN_UTMP
return 1;
# else
return 1;
# endif
}
return 0;
}
int
{
/* Clear the time entries in our logininfo */
log("wtmp_get_entry: problem opening %s: %s",
return 0;
}
log("wtmp_get_entry: couldn't stat %s: %s",
return 0;
}
/* Seek to the start of the last struct utmp */
/* Looks like we've got a fresh wtmp file */
return 0;
}
while (!found) {
log("wtmp_get_entry: read of %s failed: %s",
return 0;
}
found = 1;
/* We've already checked for a time in struct
* utmp, in login_getlast(). */
# ifdef HAVE_TIME_IN_UTMP
# else
# if HAVE_TV_IN_UTMP
# endif
# endif
# ifdef HAVE_HOST_IN_UTMP
# endif
continue;
}
/* Seek back 2 x struct utmp */
/* We've found the start of the file, so quit */
return 0;
}
}
/* We found an entry. Tidy up and return */
return 1;
}
# endif /* USE_WTMP */
/**
** Low-level wtmpx functions
**/
#ifdef USE_WTMPX
/* write a wtmpx entry direct to the end of the file */
/* This is a slight modification of code in OpenBSD's logwtmp.c */
static int
{
log("wtmpx_write: problem opening %s: %s",
return 0;
}
log("wtmpx_write: problem writing %s: %s",
ret = 0;
}
return ret;
}
static int
{
}
static int
{
}
int
{
case LTYPE_LOGIN:
return wtmpx_perform_login(li);
case LTYPE_LOGOUT:
return wtmpx_perform_logout(li);
default:
log("wtmpx_write_entry: invalid type field");
return 0;
}
}
/* Please see the notes above wtmp_islogin() for information about the
next two functions */
/* Return true if this wtmpx entry indicates a login */
static int
{
# ifdef HAVE_TYPE_IN_UTMPX
return 1;
# else
return 1;
# endif
}
return 0;
}
#if 0
int
{
/* Clear the time entries */
log("wtmpx_get_entry: problem opening %s: %s",
return 0;
}
log("wtmpx_get_entry: couldn't stat %s: %s",
return 0;
}
/* Seek to the start of the last struct utmpx */
/* probably a newly rotated wtmpx file */
return 0;
}
while (!found) {
log("wtmpx_get_entry: read of %s failed: %s",
return 0;
}
/* Logouts are recorded as a blank username on a particular line.
* So, we just need to find the username in struct utmpx */
found = 1;
# ifdef HAVE_TV_IN_UTMPX
# else
# ifdef HAVE_TIME_IN_UTMPX
# endif
# endif
# ifdef HAVE_HOST_IN_UTMPX
# endif
continue;
}
return 0;
}
}
return 1;
}
#endif
#endif /* USE_WTMPX */
/**
** Low-level libutil login() functions
**/
#ifdef USE_LOGIN
static int
{
log("syslogin_perform_login: couldn't malloc()");
return 0;
}
return 1;
}
static int
{
# ifdef HAVE_LOGOUT
char line[8];
log("syslogin_perform_logout: logout() returned an error");
# ifdef HAVE_LOGWTMP
} else {
# endif
}
/* FIXME: (ATL - if the need arises) What to do if we have
* login, but no logout? what if logout but no logwtmp? All
* routines are in libutil so they should all be there,
* but... */
# endif
return 1;
}
int
{
case LTYPE_LOGIN:
return syslogin_perform_login(li);
case LTYPE_LOGOUT:
return syslogin_perform_logout(li);
default:
log("syslogin_write_entry: Invalid type field");
return 0;
}
}
#endif /* USE_LOGIN */
/* end of file log-syslogin.c */
/**
** Low-level lastlog functions
**/
#ifdef USE_LASTLOG
#define LL_FILE 1
#define LL_DIR 2
#define LL_OTHER 3
static void
{
/* clear the structure */
}
static int
lastlog_filetype(char *filename)
{
return 0;
}
return LL_DIR;
return LL_FILE;
else
return LL_OTHER;
}
/* open the file (using filemode) and seek to the login entry */
static int
{
int type;
char lastlog_file[1024];
switch (type) {
case LL_FILE:
break;
case LL_DIR:
break;
default:
log("lastlog_openseek: %.100s is not a file or directory!",
return 0;
}
if ( *fd < 0) {
debug("lastlog_openseek: Couldn't open %s: %s",
return 0;
}
/* find this uid's offset in the lastlog file */
log("lastlog_openseek: %s->lseek(): %s",
return 0;
}
}
return 1;
}
static int
{
int fd;
/* create our struct lastlog */
return(0);
/* write the entry */
log("lastlog_write_filemode: Error writing to %s: %s",
return 0;
}
return 1;
}
int
{
case LTYPE_LOGIN:
return lastlog_perform_login(li);
default:
log("lastlog_write_entry: Invalid type field");
return 0;
}
}
static void
{
}
int
{
int fd;
return 0;
log("lastlog_get_entry: Error reading from %s: %s",
return 0;
}
return 1;
}
#endif /* USE_LASTLOG */