utmp

package
v0.14.0-rc.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UtmpxFile   = "/var/run/utmp"
	WtmpxFile   = "/var/log/wtmp"
	UserProcess = 0x7 // Normal process
	DeadProcess = 0x8 // Terminated process
)

Variables

This section is empty.

Functions

func UtmpEndSession

func UtmpEndSession(u Utmpx)

UtmpEndSession this function updates the utmp and wtmp files at the end of a user session.

Types

type ExitStatus

type ExitStatus struct {
	ETermination int16 // Process temination status - not used
	EExit        int16 // Process exit status - not used
}

type TimeVal

type TimeVal struct {
	Sec  int32 // Seconds since epoch
	Usec int32 // Microseconds
}

type Utmpx

type Utmpx struct {
	Type     int16      // UserProcess or DeadProcess
	Padding  [2]byte    // Padding to align rest of struct
	Pid      int32      // PID of the ShellHub agent
	Line     [32]byte   // tty associated with the process
	ID       [4]byte    // Index, last 4 characters of Line
	User     [32]byte   // Username
	Host     [256]byte  // Source IP address
	Exit     ExitStatus // Exit status - not used
	Session  int32      // Session ID - not used
	Tv       TimeVal    // Time entry was made
	AddrV6   [4]uint32  // Source IP address. IPv4 in AddrV6[0]
	Reserved [20]byte   // Not used
}

func UtmpStartSession

func UtmpStartSession(line, user, remoteAddr string) Utmpx

UtmpStartSession This function updates the utmp and wtmp files at the start of a user session.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL