Go bindings to maintain the traditional UNIX utmp/utmpx and lastlog, used for tracking remote terminal sessions.
Go to file
Russ Magee 907ffc4058 Fixed crash when ttyname(STDIN_FILENO) returns NULL (if parent program is a daemon)
* TODO: add ability for callers to C.pututmp() to provide pty dev name for above case

Signed-off-by: Russ Magee <rmagee@gmail.com>
2018-11-13 23:54:24 -08:00
main GetHost() now handles IPv4 and IPv6 addresses 2018-10-02 11:04:33 -07:00
LICENSE.mit Added LICENSE file 2018-10-19 18:41:15 -07:00
README.md Cleaned up README.md formatting 2018-06-27 15:27:12 -07:00
goutmp.go Fixed crash when ttyname(STDIN_FILENO) returns NULL (if parent program is a daemon) 2018-11-13 23:54:24 -08: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 string, usr string, host string)
func Unput_utmp(entry UtmpEntry)
func Put_utmp(user string, host string) UtmpEntry