mirror of
https://gogs.blitter.com/RLabs/goutmp
synced 2024-08-14 19:26:41 +00:00
Go bindings to maintain the traditional UNIX utmp/utmpx and lastlog, used for tracking remote terminal sessions.
f388f970e4
Signed-off-by: Russ Magee <rmagee@gmail.com> |
||
---|---|---|
main | ||
goutmp.go | ||
LICENSE.mit | ||
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 string, usr string, host string)
func Unput_utmp(entry UtmpEntry)
func Put_utmp(user string, host string) UtmpEntry