Go bindings to maintain the traditional UNIX utmp/utmpx and lastlog, used for tracking remote terminal sessions.
Go to file
Russ Magee e75ee8b119 go.mod 2022-03-19 09:01:33 -07:00
main Added missing arg for linux test 2022-03-19 00:13:23 -07:00
LICENSE.mit Added LICENSE file 2018-10-19 18:41:15 -07:00
README.md Update 'README.md' 2019-07-06 00:23:16 -07:00
go.mod go.mod 2022-03-19 09:01:33 -07:00
goutmp_bsd.go More fixes to +build constraints (oops, freebsd not bsd) 2020-04-25 19:42:32 -07:00
goutmp_linux.go Fixed +build constraints 2020-04-25 18:39:08 -07:00

README.md

goutmp - Minimal bindings to C stdlib pututmpx(), getutmpx() (/var/log/wtmp) and /var/log/lastlog

Any Go program which allows user shell access should update the standard UNIX files which track user sessions: /var/log/wtmp (for the 'w' and 'who' commands), and /var/log/lastlog (the 'last' and 'lastlog' commands).

go doc
package goutmp // import "blitter.com/go/goutmp"

Golang bindings for basic login/utmp accounting

type UtmpEntry struct{ ... }

func Put_lastlog_entry(app, usr, ptsname, host string)
func Unput_utmp(entry UtmpEntry)
func Put_utmp(user, ptsname, host string) UtmpEntry