2007-10-07 17:14:02 +05:30
|
|
|
/*
|
2008-04-27 06:10:09 +05:30
|
|
|
* Copyright (c) 1989 - 1994, Julianne Frances Haugh
|
|
|
|
* Copyright (c) 1996 - 1999, Marek Michałkiewicz
|
|
|
|
* Copyright (c) 2001 - 2005, Tomasz Kłoczko
|
|
|
|
* Copyright (c) 2008 , Nicolas François
|
2007-10-07 17:14:02 +05:30
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
2008-04-27 06:10:09 +05:30
|
|
|
* 3. The name of the copyright holders or contributors may not be used to
|
|
|
|
* endorse or promote products derived from this software without
|
|
|
|
* specific prior written permission.
|
2007-10-07 17:14:02 +05:30
|
|
|
*
|
2008-04-27 06:10:09 +05:30
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
* ``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 COPYRIGHT
|
|
|
|
* HOLDERS OR CONTRIBUTORS 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.
|
2007-10-07 17:14:02 +05:30
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#include "defines.h"
|
2008-01-05 18:53:22 +05:30
|
|
|
#include "prototypes.h"
|
2007-10-07 17:14:02 +05:30
|
|
|
|
|
|
|
#include <utmp.h>
|
|
|
|
|
|
|
|
#if HAVE_UTMPX_H
|
|
|
|
#include <utmpx.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
2007-11-11 05:16:11 +05:30
|
|
|
#ident "$Id$"
|
2007-10-07 17:17:01 +05:30
|
|
|
|
2007-10-07 17:14:02 +05:30
|
|
|
#if HAVE_UTMPX_H
|
2007-10-07 17:15:14 +05:30
|
|
|
struct utmpx utxent;
|
2007-10-07 17:14:02 +05:30
|
|
|
#endif
|
2007-10-07 17:15:14 +05:30
|
|
|
struct utmp utent;
|
2007-10-07 17:14:02 +05:30
|
|
|
|
|
|
|
#define NO_UTENT \
|
2007-10-07 17:17:01 +05:30
|
|
|
_("No utmp entry. You must exec \"login\" from the lowest level \"sh\"")
|
2007-10-07 17:14:02 +05:30
|
|
|
#define NO_TTY \
|
2007-10-07 17:17:01 +05:30
|
|
|
_("Unable to determine your tty name.")
|
2007-10-07 17:14:02 +05:30
|
|
|
|
|
|
|
/*
|
|
|
|
* checkutmp - see if utmp file is correct for this process
|
|
|
|
*
|
|
|
|
* System V is very picky about the contents of the utmp file
|
|
|
|
* and requires that a slot for the current process exist.
|
|
|
|
* The utmp file is scanned for an entry with the same process
|
|
|
|
* ID. If no entry exists the process exits with a message.
|
|
|
|
*
|
|
|
|
* The "picky" flag is for network and other logins that may
|
|
|
|
* use special flags. It allows the pid checks to be overridden.
|
|
|
|
* This means that getty should never invoke login with any
|
|
|
|
* command line flags.
|
|
|
|
*/
|
|
|
|
|
2007-10-07 17:15:23 +05:30
|
|
|
#if defined(__linux__) /* XXX */
|
2007-10-07 17:14:02 +05:30
|
|
|
|
2008-05-26 05:56:33 +05:30
|
|
|
void checkutmp (bool picky)
|
2007-10-07 17:14:02 +05:30
|
|
|
{
|
|
|
|
char *line;
|
|
|
|
struct utmp *ut;
|
2007-10-07 17:15:23 +05:30
|
|
|
pid_t pid = getpid ();
|
2007-10-07 17:14:02 +05:30
|
|
|
|
2007-10-07 17:15:23 +05:30
|
|
|
setutent ();
|
2007-10-07 17:14:02 +05:30
|
|
|
|
|
|
|
/* First, try to find a valid utmp entry for this process. */
|
2007-10-07 17:15:23 +05:30
|
|
|
while ((ut = getutent ()))
|
2007-10-07 17:14:02 +05:30
|
|
|
if (ut->ut_pid == pid && ut->ut_line[0] && ut->ut_id[0] &&
|
2007-10-07 17:15:23 +05:30
|
|
|
(ut->ut_type == LOGIN_PROCESS
|
|
|
|
|| ut->ut_type == USER_PROCESS))
|
2007-10-07 17:14:02 +05:30
|
|
|
break;
|
|
|
|
|
|
|
|
/* If there is one, just use it, otherwise create a new one. */
|
|
|
|
if (ut) {
|
|
|
|
utent = *ut;
|
|
|
|
} else {
|
|
|
|
if (picky) {
|
2007-10-07 17:15:23 +05:30
|
|
|
puts (NO_UTENT);
|
|
|
|
exit (1);
|
2007-10-07 17:14:02 +05:30
|
|
|
}
|
2007-10-07 17:15:23 +05:30
|
|
|
line = ttyname (0);
|
2007-10-07 17:14:02 +05:30
|
|
|
if (!line) {
|
2007-10-07 17:15:23 +05:30
|
|
|
puts (NO_TTY);
|
|
|
|
exit (1);
|
2007-10-07 17:14:02 +05:30
|
|
|
}
|
2007-10-07 17:15:23 +05:30
|
|
|
if (strncmp (line, "/dev/", 5) == 0)
|
2007-10-07 17:14:02 +05:30
|
|
|
line += 5;
|
2007-10-07 17:15:23 +05:30
|
|
|
memset ((void *) &utent, 0, sizeof utent);
|
2007-10-07 17:14:02 +05:30
|
|
|
utent.ut_type = LOGIN_PROCESS;
|
|
|
|
utent.ut_pid = pid;
|
2007-10-07 17:15:23 +05:30
|
|
|
strncpy (utent.ut_line, line, sizeof utent.ut_line);
|
2007-10-07 17:14:02 +05:30
|
|
|
/* XXX - assumes /dev/tty?? */
|
2007-10-07 17:16:07 +05:30
|
|
|
strncpy (utent.ut_id, utent.ut_line + 3, sizeof utent.ut_id);
|
2007-10-07 17:15:23 +05:30
|
|
|
strcpy (utent.ut_user, "LOGIN");
|
|
|
|
utent.ut_time = time (NULL);
|
2007-10-07 17:14:02 +05:30
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#elif defined(LOGIN_PROCESS)
|
|
|
|
|
2008-05-26 03:41:12 +05:30
|
|
|
void checkutmp (bool picky)
|
2007-10-07 17:14:02 +05:30
|
|
|
{
|
|
|
|
char *line;
|
|
|
|
struct utmp *ut;
|
2007-10-07 17:15:23 +05:30
|
|
|
|
2007-10-07 17:14:02 +05:30
|
|
|
#if HAVE_UTMPX_H
|
|
|
|
struct utmpx *utx;
|
|
|
|
#endif
|
2007-10-07 17:15:23 +05:30
|
|
|
pid_t pid = getpid ();
|
2007-10-07 17:14:02 +05:30
|
|
|
|
|
|
|
#if HAVE_UTMPX_H
|
2007-10-07 17:15:23 +05:30
|
|
|
setutxent ();
|
2007-10-07 17:14:02 +05:30
|
|
|
#endif
|
2007-10-07 17:15:23 +05:30
|
|
|
setutent ();
|
2007-10-07 17:14:02 +05:30
|
|
|
|
|
|
|
if (picky) {
|
|
|
|
#if HAVE_UTMPX_H
|
2007-10-07 17:15:23 +05:30
|
|
|
while ((utx = getutxent ()))
|
2007-10-07 17:14:02 +05:30
|
|
|
if (utx->ut_pid == pid)
|
|
|
|
break;
|
|
|
|
|
|
|
|
if (utx)
|
|
|
|
utxent = *utx;
|
|
|
|
#endif
|
2007-10-07 17:15:23 +05:30
|
|
|
while ((ut = getutent ()))
|
2007-10-07 17:14:02 +05:30
|
|
|
if (ut->ut_pid == pid)
|
|
|
|
break;
|
|
|
|
|
|
|
|
if (ut)
|
|
|
|
utent = *ut;
|
|
|
|
|
|
|
|
#if HAVE_UTMPX_H
|
2007-10-07 17:15:23 +05:30
|
|
|
endutxent ();
|
2007-10-07 17:14:02 +05:30
|
|
|
#endif
|
2007-10-07 17:15:23 +05:30
|
|
|
endutent ();
|
2007-10-07 17:14:02 +05:30
|
|
|
|
|
|
|
if (!ut) {
|
2007-10-07 17:15:23 +05:30
|
|
|
puts (NO_UTENT);
|
|
|
|
exit (1);
|
2007-10-07 17:14:02 +05:30
|
|
|
}
|
|
|
|
#ifndef UNIXPC
|
|
|
|
|
|
|
|
/*
|
|
|
|
* If there is no ut_line value in this record, fill
|
|
|
|
* it in by getting the TTY name and stuffing it in
|
|
|
|
* the structure. The UNIX/PC is broken in this regard
|
|
|
|
* and needs help ...
|
|
|
|
*/
|
|
|
|
|
|
|
|
if (utent.ut_line[0] == '\0')
|
2007-10-07 17:15:23 +05:30
|
|
|
#endif /* !UNIXPC */
|
2007-10-07 17:14:02 +05:30
|
|
|
{
|
2007-10-07 17:15:23 +05:30
|
|
|
if (!(line = ttyname (0))) {
|
|
|
|
puts (NO_TTY);
|
|
|
|
exit (1);
|
2007-10-07 17:14:02 +05:30
|
|
|
}
|
2007-10-07 17:15:23 +05:30
|
|
|
if (strncmp (line, "/dev/", 5) == 0)
|
2007-10-07 17:14:02 +05:30
|
|
|
line += 5;
|
2007-10-07 17:16:07 +05:30
|
|
|
strncpy (utent.ut_line, line, sizeof utent.ut_line);
|
2007-10-07 17:14:02 +05:30
|
|
|
#if HAVE_UTMPX_H
|
2007-10-07 17:16:07 +05:30
|
|
|
strncpy (utxent.ut_line, line, sizeof utxent.ut_line);
|
2007-10-07 17:14:02 +05:30
|
|
|
#endif
|
|
|
|
}
|
|
|
|
} else {
|
2007-10-07 17:15:23 +05:30
|
|
|
if (!(line = ttyname (0))) {
|
|
|
|
puts (NO_TTY);
|
|
|
|
exit (1);
|
2007-10-07 17:14:02 +05:30
|
|
|
}
|
2007-10-07 17:15:23 +05:30
|
|
|
if (strncmp (line, "/dev/", 5) == 0)
|
2007-10-07 17:14:02 +05:30
|
|
|
line += 5;
|
|
|
|
|
2007-10-07 17:15:23 +05:30
|
|
|
strncpy (utent.ut_line, line, sizeof utent.ut_line);
|
|
|
|
if ((ut = getutline (&utent)))
|
|
|
|
strncpy (utent.ut_id, ut->ut_id, sizeof ut->ut_id);
|
2007-10-07 17:14:02 +05:30
|
|
|
|
2007-10-07 17:15:23 +05:30
|
|
|
strcpy (utent.ut_user, "LOGIN");
|
|
|
|
utent.ut_pid = getpid ();
|
2007-10-07 17:14:02 +05:30
|
|
|
utent.ut_type = LOGIN_PROCESS;
|
2007-10-07 17:15:23 +05:30
|
|
|
utent.ut_time = time (NULL);
|
2007-10-07 17:14:02 +05:30
|
|
|
#if HAVE_UTMPX_H
|
2007-10-07 17:15:23 +05:30
|
|
|
strncpy (utxent.ut_line, line, sizeof utxent.ut_line);
|
|
|
|
if ((utx = getutxline (&utxent)))
|
2007-10-07 17:16:07 +05:30
|
|
|
strncpy (utxent.ut_id, utx->ut_id, sizeof utxent.ut_id);
|
2007-10-07 17:14:02 +05:30
|
|
|
|
2007-10-07 17:15:23 +05:30
|
|
|
strcpy (utxent.ut_user, "LOGIN");
|
2007-10-07 17:14:02 +05:30
|
|
|
utxent.ut_pid = utent.ut_pid;
|
|
|
|
utxent.ut_type = utent.ut_type;
|
2007-10-07 17:15:23 +05:30
|
|
|
if (sizeof (utxent.ut_tv) == sizeof (struct timeval))
|
2007-10-07 17:16:07 +05:30
|
|
|
gettimeofday ((struct timeval *) &utxent.ut_tv, NULL);
|
2007-10-07 17:15:23 +05:30
|
|
|
else {
|
|
|
|
struct timeval tv;
|
|
|
|
|
|
|
|
gettimeofday (&tv, NULL);
|
|
|
|
utxent.ut_tv.tv_sec = tv.tv_sec;
|
|
|
|
utxent.ut_tv.tv_usec = tv.tv_usec;
|
|
|
|
}
|
2007-10-07 17:14:02 +05:30
|
|
|
utent.ut_time = utxent.ut_tv.tv_sec;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-10-07 17:16:34 +05:30
|
|
|
#endif
|
2007-10-07 17:14:02 +05:30
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Some systems already have updwtmp() and possibly updwtmpx(). Others
|
|
|
|
* don't, so we re-implement these functions if necessary. --marekm
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef HAVE_UPDWTMP
|
2007-10-07 17:15:23 +05:30
|
|
|
static void updwtmp (const char *filename, const struct utmp *ut)
|
2007-10-07 17:14:02 +05:30
|
|
|
{
|
|
|
|
int fd;
|
|
|
|
|
2007-10-07 17:15:23 +05:30
|
|
|
fd = open (filename, O_APPEND | O_WRONLY, 0);
|
2007-10-07 17:14:02 +05:30
|
|
|
if (fd >= 0) {
|
2007-10-07 17:15:23 +05:30
|
|
|
write (fd, (const char *) ut, sizeof (*ut));
|
|
|
|
close (fd);
|
2007-10-07 17:14:02 +05:30
|
|
|
}
|
|
|
|
}
|
2007-10-07 17:15:23 +05:30
|
|
|
#endif /* ! HAVE_UPDWTMP */
|
2007-10-07 17:14:02 +05:30
|
|
|
|
|
|
|
#ifdef HAVE_UTMPX_H
|
|
|
|
#ifndef HAVE_UPDWTMPX
|
2007-10-07 17:15:23 +05:30
|
|
|
static void updwtmpx (const char *filename, const struct utmpx *utx)
|
2007-10-07 17:14:02 +05:30
|
|
|
{
|
|
|
|
int fd;
|
|
|
|
|
2007-10-07 17:15:23 +05:30
|
|
|
fd = open (filename, O_APPEND | O_WRONLY, 0);
|
2007-10-07 17:14:02 +05:30
|
|
|
if (fd >= 0) {
|
2007-10-07 17:15:23 +05:30
|
|
|
write (fd, (const char *) utx, sizeof (*utx));
|
|
|
|
close (fd);
|
2007-10-07 17:14:02 +05:30
|
|
|
}
|
|
|
|
}
|
2007-10-07 17:15:23 +05:30
|
|
|
#endif /* ! HAVE_UPDWTMPX */
|
|
|
|
#endif /* ! HAVE_UTMPX_H */
|
2007-10-07 17:14:02 +05:30
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* setutmp - put a USER_PROCESS entry in the utmp file
|
|
|
|
*
|
|
|
|
* setutmp changes the type of the current utmp entry to
|
|
|
|
* USER_PROCESS. the wtmp file will be updated as well.
|
|
|
|
*/
|
|
|
|
|
2007-10-07 17:15:23 +05:30
|
|
|
#if defined(__linux__) /* XXX */
|
2007-10-07 17:14:02 +05:30
|
|
|
|
2007-10-07 17:15:23 +05:30
|
|
|
void setutmp (const char *name, const char *line, const char *host)
|
2007-10-07 17:14:02 +05:30
|
|
|
{
|
|
|
|
utent.ut_type = USER_PROCESS;
|
2007-10-07 17:15:23 +05:30
|
|
|
strncpy (utent.ut_user, name, sizeof utent.ut_user);
|
|
|
|
utent.ut_time = time (NULL);
|
2007-10-07 17:14:02 +05:30
|
|
|
/* other fields already filled in by checkutmp above */
|
2007-10-07 17:15:23 +05:30
|
|
|
setutent ();
|
|
|
|
pututline (&utent);
|
|
|
|
endutent ();
|
|
|
|
updwtmp (_WTMP_FILE, &utent);
|
2007-10-07 17:14:02 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
#elif HAVE_UTMPX_H
|
|
|
|
|
2007-10-07 17:15:23 +05:30
|
|
|
void setutmp (const char *name, const char *line, const char *host)
|
2007-10-07 17:14:02 +05:30
|
|
|
{
|
2007-10-07 17:15:23 +05:30
|
|
|
struct utmp *utmp, utline;
|
|
|
|
struct utmpx *utmpx, utxline;
|
|
|
|
pid_t pid = getpid ();
|
2008-05-26 03:41:12 +05:30
|
|
|
bool found_utmpx = false, found_utmp = false;
|
2007-10-07 17:14:02 +05:30
|
|
|
|
|
|
|
/*
|
|
|
|
* The canonical device name doesn't include "/dev/"; skip it
|
|
|
|
* if it is already there.
|
|
|
|
*/
|
|
|
|
|
|
|
|
if (strncmp (line, "/dev/", 5) == 0)
|
|
|
|
line += 5;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Update utmpx. We create an empty entry in case there is
|
|
|
|
* no matching entry in the utmpx file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
setutxent ();
|
|
|
|
setutent ();
|
|
|
|
|
2008-06-13 23:47:10 +05:30
|
|
|
while ((utmpx = getutxent ()) != NULL) {
|
2007-10-07 17:14:02 +05:30
|
|
|
if (utmpx->ut_pid == pid) {
|
2008-05-26 03:41:12 +05:30
|
|
|
found_utmpx = true;
|
2007-10-07 17:14:02 +05:30
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2008-06-13 23:47:10 +05:30
|
|
|
while ((utmp = getutent ()) != NULL) {
|
2007-10-07 17:14:02 +05:30
|
|
|
if (utmp->ut_pid == pid) {
|
2008-05-26 03:41:12 +05:30
|
|
|
found_utmp = true;
|
2007-10-07 17:14:02 +05:30
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* If the entry matching `pid' cannot be found, create a new
|
|
|
|
* entry with the device name in it.
|
|
|
|
*/
|
|
|
|
|
2007-10-07 17:15:23 +05:30
|
|
|
if (!found_utmpx) {
|
2007-10-07 17:14:02 +05:30
|
|
|
memset ((void *) &utxline, 0, sizeof utxline);
|
|
|
|
strncpy (utxline.ut_line, line, sizeof utxline.ut_line);
|
|
|
|
utxline.ut_pid = getpid ();
|
|
|
|
} else {
|
|
|
|
utxline = *utmpx;
|
|
|
|
if (strncmp (utxline.ut_line, "/dev/", 5) == 0) {
|
|
|
|
memmove (utxline.ut_line, utxline.ut_line + 5,
|
2007-10-07 17:15:23 +05:30
|
|
|
sizeof utxline.ut_line - 5);
|
2007-10-07 17:14:02 +05:30
|
|
|
utxline.ut_line[sizeof utxline.ut_line - 5] = '\0';
|
|
|
|
}
|
|
|
|
}
|
2007-10-07 17:15:23 +05:30
|
|
|
if (!found_utmp) {
|
2007-10-07 17:14:02 +05:30
|
|
|
memset ((void *) &utline, 0, sizeof utline);
|
|
|
|
strncpy (utline.ut_line, utxline.ut_line,
|
2007-10-07 17:15:23 +05:30
|
|
|
sizeof utline.ut_line);
|
2007-10-07 17:14:02 +05:30
|
|
|
utline.ut_pid = utxline.ut_pid;
|
|
|
|
} else {
|
|
|
|
utline = *utmp;
|
|
|
|
if (strncmp (utline.ut_line, "/dev/", 5) == 0) {
|
|
|
|
memmove (utline.ut_line, utline.ut_line + 5,
|
2007-10-07 17:15:23 +05:30
|
|
|
sizeof utline.ut_line - 5);
|
2007-10-07 17:14:02 +05:30
|
|
|
utline.ut_line[sizeof utline.ut_line - 5] = '\0';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Fill in the fields in the utmpx entry and write it out. Do
|
|
|
|
* the utmp entry at the same time to make sure things don't
|
|
|
|
* get messed up.
|
|
|
|
*/
|
|
|
|
|
|
|
|
strncpy (utxline.ut_user, name, sizeof utxline.ut_user);
|
|
|
|
strncpy (utline.ut_user, name, sizeof utline.ut_user);
|
|
|
|
|
|
|
|
utline.ut_type = utxline.ut_type = USER_PROCESS;
|
|
|
|
|
2007-10-07 17:15:23 +05:30
|
|
|
if (sizeof (utxline.ut_tv) == sizeof (struct timeval))
|
|
|
|
gettimeofday ((struct timeval *) &utxline.ut_tv, NULL);
|
|
|
|
else {
|
|
|
|
struct timeval tv;
|
|
|
|
|
|
|
|
gettimeofday (&tv, NULL);
|
|
|
|
utxline.ut_tv.tv_sec = tv.tv_sec;
|
|
|
|
utxline.ut_tv.tv_usec = tv.tv_usec;
|
|
|
|
}
|
2007-10-07 17:14:02 +05:30
|
|
|
utline.ut_time = utxline.ut_tv.tv_sec;
|
|
|
|
|
2007-10-07 17:16:07 +05:30
|
|
|
strncpy (utxline.ut_host, host ? host : "", sizeof utxline.ut_host);
|
2007-10-07 17:14:02 +05:30
|
|
|
|
|
|
|
pututxline (&utxline);
|
|
|
|
pututline (&utline);
|
2008-05-26 03:41:12 +05:30
|
|
|
/* TODO: log failures */
|
2007-10-07 17:14:02 +05:30
|
|
|
|
2007-10-07 17:15:23 +05:30
|
|
|
updwtmpx (_WTMP_FILE "x", &utxline);
|
|
|
|
updwtmp (_WTMP_FILE, &utline);
|
2007-10-07 17:14:02 +05:30
|
|
|
|
|
|
|
utxent = utxline;
|
|
|
|
utent = utline;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|