Go bindings to maintain the traditional UNIX utmp/utmpx and lastlog, used for tracking remote terminal sessions.

Russ Magee c3193d4a77 More fixes to +build constraints (oops, freebsd not bsd) 1 year ago
main c3193d4a77 More fixes to +build constraints (oops, freebsd not bsd) 1 year ago
LICENSE.mit 9a2ce6f43e Added LICENSE file 3 years ago
README.md 2b9cd1bafd Update 'README.md' 2 years ago
goutmp_bsd.go c3193d4a77 More fixes to +build constraints (oops, freebsd not bsd) 1 year ago
goutmp_linux.go 74d785142e Fixed +build constraints 1 year ago

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