1*0c3983b2SBen Gras.\" $NetBSD: login.3,v 1.6 2003/08/07 16:44:58 agc Exp $ 2*0c3983b2SBen Gras.\" 3*0c3983b2SBen Gras.\" Copyright (c) 1995 4*0c3983b2SBen Gras.\" The Regents of the University of California. All rights reserved. 5*0c3983b2SBen Gras.\" 6*0c3983b2SBen Gras.\" This code is derived from software developed by the Computer Systems 7*0c3983b2SBen Gras.\" Engineering group at Lawrence Berkeley Laboratory under DARPA contract 8*0c3983b2SBen Gras.\" BG 91-66 and contributed to Berkeley. 9*0c3983b2SBen Gras.\" 10*0c3983b2SBen Gras.\" Redistribution and use in source and binary forms, with or without 11*0c3983b2SBen Gras.\" modification, are permitted provided that the following conditions 12*0c3983b2SBen Gras.\" are met: 13*0c3983b2SBen Gras.\" 1. Redistributions of source code must retain the above copyright 14*0c3983b2SBen Gras.\" notice, this list of conditions and the following disclaimer. 15*0c3983b2SBen Gras.\" 2. Redistributions in binary form must reproduce the above copyright 16*0c3983b2SBen Gras.\" notice, this list of conditions and the following disclaimer in the 17*0c3983b2SBen Gras.\" documentation and/or other materials provided with the distribution. 18*0c3983b2SBen Gras.\" 3. Neither the name of the University nor the names of its contributors 19*0c3983b2SBen Gras.\" may be used to endorse or promote products derived from this software 20*0c3983b2SBen Gras.\" without specific prior written permission. 21*0c3983b2SBen Gras.\" 22*0c3983b2SBen Gras.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 23*0c3983b2SBen Gras.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24*0c3983b2SBen Gras.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25*0c3983b2SBen Gras.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 26*0c3983b2SBen Gras.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27*0c3983b2SBen Gras.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28*0c3983b2SBen Gras.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29*0c3983b2SBen Gras.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30*0c3983b2SBen Gras.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31*0c3983b2SBen Gras.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32*0c3983b2SBen Gras.\" SUCH DAMAGE. 33*0c3983b2SBen Gras.\" 34*0c3983b2SBen Gras.Dd December 14, 1995 35*0c3983b2SBen Gras.Dt LOGIN 3 36*0c3983b2SBen Gras.Os 37*0c3983b2SBen Gras.Sh NAME 38*0c3983b2SBen Gras.Nm login , 39*0c3983b2SBen Gras.Nm logout , 40*0c3983b2SBen Gras.Nm logwtmp 41*0c3983b2SBen Gras.Nd login utility functions 42*0c3983b2SBen Gras.Sh LIBRARY 43*0c3983b2SBen Gras.Lb libutil 44*0c3983b2SBen Gras.Sh SYNOPSIS 45*0c3983b2SBen Gras.In util.h 46*0c3983b2SBen Gras.Ft void 47*0c3983b2SBen Gras.Fn login "struct utmp *ut" 48*0c3983b2SBen Gras.Ft int 49*0c3983b2SBen Gras.Fn logout "const char *line" 50*0c3983b2SBen Gras.Ft void 51*0c3983b2SBen Gras.Fn logwtmp "const char *line" "const char *name" "const char *host" 52*0c3983b2SBen Gras.Sh DESCRIPTION 53*0c3983b2SBen GrasThe 54*0c3983b2SBen Gras.Fn login , 55*0c3983b2SBen Gras.Fn logout , 56*0c3983b2SBen Grasand 57*0c3983b2SBen Gras.Fn logwtmp 58*0c3983b2SBen Grasfunctions operate on the database of current users in 59*0c3983b2SBen Gras.Pa /var/run/utmp 60*0c3983b2SBen Grasand on the logfile 61*0c3983b2SBen Gras.Pa /var/log/wtmp 62*0c3983b2SBen Grasof logins and logouts. 63*0c3983b2SBen Gras.Pp 64*0c3983b2SBen GrasThe 65*0c3983b2SBen Gras.Fn login 66*0c3983b2SBen Grasfunction updates the 67*0c3983b2SBen Gras.Pa /var/run/utmp 68*0c3983b2SBen Grasand 69*0c3983b2SBen Gras.Pa /var/log/wtmp 70*0c3983b2SBen Grasfiles with user information contained in 71*0c3983b2SBen Gras.Fa ut . 72*0c3983b2SBen Gras.Pp 73*0c3983b2SBen GrasThe 74*0c3983b2SBen Gras.Fn logout 75*0c3983b2SBen Grasfunction removes the entry from 76*0c3983b2SBen Gras.Pa /var/run/utmp 77*0c3983b2SBen Grascorresponding to the device 78*0c3983b2SBen Gras.Fa line . 79*0c3983b2SBen Gras.Pp 80*0c3983b2SBen GrasThe 81*0c3983b2SBen Gras.Fn logwtmp 82*0c3983b2SBen Grasfunction adds an entry to 83*0c3983b2SBen Gras.Pa /var/log/wtmp . 84*0c3983b2SBen GrasSince 85*0c3983b2SBen Gras.Fn login 86*0c3983b2SBen Graswill add the appropriate entry for 87*0c3983b2SBen Gras.Pa /var/log/wtmp 88*0c3983b2SBen Grasduring a login, 89*0c3983b2SBen Gras.Fn logwtmp 90*0c3983b2SBen Grasis usually used for logouts. 91*0c3983b2SBen Gras.Sh RETURN VALUES 92*0c3983b2SBen Gras.Fn logout 93*0c3983b2SBen Grasreturns non-zero if it was able to find and delete an entry for 94*0c3983b2SBen Gras.Fa line , 95*0c3983b2SBen Grasand zero if there is no entry for 96*0c3983b2SBen Gras.Fa line 97*0c3983b2SBen Grasin 98*0c3983b2SBen Gras.Pa /var/run/utmp . 99*0c3983b2SBen Gras.Sh FILES 100*0c3983b2SBen Gras.Bl -tag -width /var/run/wtmp -compact 101*0c3983b2SBen Gras.It Pa /dev/\(** 102*0c3983b2SBen Gras.It Pa /etc/ttys 103*0c3983b2SBen Gras.It Pa /var/run/utmp 104*0c3983b2SBen Gras.It Pa /var/log/wtmp 105*0c3983b2SBen Gras.El 106*0c3983b2SBen Gras.Sh SEE ALSO 107*0c3983b2SBen Gras.Xr utmp 5 108