.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Sys::Utmp::Utent 3pm" .TH Sys::Utmp::Utent 3pm "2018-11-01" "perl v5.28.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Sys::Utmp::Utent \- represent a single utmp entry .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Sys::Utmp; \& \& my $utmp = Sys::Utmp\->new(); \& \& while ( my $utent = $utmp\->getutent() ) \& { \& if ( $utent\->user_process ) \& { \& print $utent\->ut_user,"\en"; \& } \& } \& \& $utmp\->endutent; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" As described in the Sys::Utmp documentation the getutent method returns an object of the type Sys::Utmp::Utent which provides methods for accessing the fields in the utmp record. There are also methods for determining the type of the record. .PP The access methods relate to the common names for the members of the C struct utent \- those provided are the superset from the Gnu implementation and may not be available on all systems: where they are not they will return the empty string. .IP "ut_user" 4 .IX Item "ut_user" Returns the use this record was created for if this is a record for a user process. Some systems may return other information depending on the record type. If no user was set this will be the empty string. If tainting is switched on with the '\-T' switch to perl then this will be 'tainted' as it is possible that the user name came from an untrusted source. .IP "ut_id" 4 .IX Item "ut_id" The identifier for this record \- it might be the inittab tag or some other system dependent value. .IP "ut_line" 4 .IX Item "ut_line" For user process records this will be the name of the terminalor line that the user is connected on. .IP "ut_pid" 4 .IX Item "ut_pid" The process \s-1ID\s0 of the process that created this record. .IP "ut_type" 4 .IX Item "ut_type" The type of the record this will have a value corresponding to one of the constants (not all of these may be available on all systems and there may well be others which should be described in the getutent manpage or in /usr/include/utmp.h ) : .RS 4 .IP "\s-1ACCOUNTING\s0 \- record was created for system accounting purposes." 2 .IX Item "ACCOUNTING - record was created for system accounting purposes." .PD 0 .IP "\s-1BOOT_TIME\s0 \- the record was created at boot time." 2 .IX Item "BOOT_TIME - the record was created at boot time." .IP "\s-1DEAD_PROCESS\s0 \- The process that created this record has terminated." 2 .IX Item "DEAD_PROCESS - The process that created this record has terminated." .IP "\s-1EMPTY\s0 \- record probably contains no other useful information." 2 .IX Item "EMPTY - record probably contains no other useful information." .IP "\s-1INIT_PROCESS\s0 \- this is a record for process created by init." 2 .IX Item "INIT_PROCESS - this is a record for process created by init." .IP "\s-1LOGIN_PROCESS\s0 \- this record was created for a login process (e.g. getty)." 2 .IX Item "LOGIN_PROCESS - this record was created for a login process (e.g. getty)." .IP "\s-1NEW_TIME\s0 \- record created when the system time has been set." 2 .IX Item "NEW_TIME - record created when the system time has been set." .IP "\s-1OLD_TIME\s0 \- record recording the old tme when the system time has been set." 2 .IX Item "OLD_TIME - record recording the old tme when the system time has been set." .IP "\s-1RUN_LVL\s0 \- records the time at which the current run level was started." 2 .IX Item "RUN_LVL - records the time at which the current run level was started." .IP "\s-1USER_PROCESS\s0 \- record created for a user process (e.g. a login )" 2 .IX Item "USER_PROCESS - record created for a user process (e.g. a login )" .RE .RS 4 .PD .Sp for convenience Sys::Utmp::Utent provides methods which are lower case versions of the constant names which return true if the record is of that type. .RE .IP "ut_host" 4 .IX Item "ut_host" On systems which support this the method will return the hostname of the host for which the process that created the record was started \- for example for a telnet login. If taint checking has been turned on (with the \-T switch to perl ) then this value will be tainted as it is possible that a remote user will be in control of the \s-1DNS\s0 for the machine they have logged in from. ( see perlsec for more on tainting ) .IP "ut_time" 4 .IX Item "ut_time" The time in epoch seconds wt which the record was created. .SH "BUGS" .IX Header "BUGS" Probably. This module has been tested on Linux, Solaris, FreeBSD ,SCO Openserver and \s-1SCO\s0 UnixWare and found to work on those platforms. If you have difficulty building the module or it doesnt behave as expected then please contact the author including if appropriate your /usr/include/utmp.h .SH "AUTHOR" .IX Header "AUTHOR" Jonathan Stowe, .SH "LICENCE" .IX Header "LICENCE" This Software is Copyright Jonathan Stowe 2001\-2013 .PP This Software is published as-is with no warranty express or implied. .PP This is free software and can be distributed under the same terms as Perl itself. .SH "SEE ALSO" .IX Header "SEE ALSO" perl. Sys::Utmp