diff options
author | Eric Andersen <andersen@codepoet.org> | 2003-06-24 03:14:19 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2003-06-24 03:14:19 +0000 |
commit | efe2271a53aee5145308349d31e6d45a8571758a (patch) | |
tree | 9f266c62e10433ab082395df75fb3d77d8be476c | |
parent | 557e404d6595bed6be66076577b829a00f39eda4 (diff) |
Make login actually write out utmp and wtmp junk (even
though such things are completly unreliable crap)
-rw-r--r-- | libutil/login.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/libutil/login.c b/libutil/login.c index 636ce9608..2e9a5cb25 100644 --- a/libutil/login.c +++ b/libutil/login.c @@ -8,7 +8,18 @@ /* Write the given entry into utmp and wtmp. */ void login (const struct utmp *entry) { - return; + struct utmp copy = *entry; + + utmpname(_PATH_UTMP); + setutent(); +#if _HAVE_UT_TYPE - 0 + copy.ut_type = USER_PROCESS; +#endif +#if _HAVE_UT_PID - 0 + copy.ut_pid = getpid(); +#endif + strncpy (copy.ut_line, entry->ut_line, UT_LINESIZE); + pututline(entry); + endutent(); } -link_warning (login, "the `login' function is stubbed out and will not write utmp or wtmp.") |