summaryrefslogtreecommitdiffstats
path: root/login.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>1999-12-31 09:42:24 +1100
committerDamien Miller <djm@mindrot.org>1999-12-31 09:42:24 +1100
commit3131d8bc717b2fad9b5e13a1ac1b1c1b726b3dd4 (patch)
treee9376356591e18fa49588564f5167107afea7654 /login.c
parentb2532b3be4133d2ea7bf6acaf2b0edb8217d356e (diff)
- Fill in ut_utaddr utmp field. Report from Benjamin Charron
<iretd@bigfoot.com>
Diffstat (limited to 'login.c')
-rw-r--r--login.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/login.c b/login.c
index 5c58d814..3dd208aa 100644
--- a/login.c
+++ b/login.c
@@ -18,7 +18,7 @@
*/
#include "includes.h"
-RCSID("$Id: login.c,v 1.15 1999/12/28 15:32:22 damien Exp $");
+RCSID("$Id: login.c,v 1.16 1999/12/30 22:42:24 damien Exp $");
#if defined(HAVE_UTMPX_H) && defined(USE_UTMPX)
# include <utmpx.h>
@@ -159,6 +159,9 @@ record_login(int pid, const char *ttyname, const char *user, uid_t uid,
#if defined(HAVE_HOST_IN_UTMP)
strncpy(u.ut_host, host, sizeof(u.ut_host));
#endif
+#if defined(HAVE_ADDR_IN_UTMP)
+ u.ut_addr = addr->sin_addr.s_addr;
+#endif
#if defined(HAVE_UTMPX_H) && defined(USE_UTMPX)
memset(&utx, 0, sizeof(utx));
@@ -176,6 +179,9 @@ record_login(int pid, const char *ttyname, const char *user, uid_t uid,
strncpy(utx.ut_host, host, sizeof(utx.ut_host));
# endif /* HAVE_SYSLEN_IN_UTMPX */
# endif
+# if defined(HAVE_ADDR_IN_UTMPX)
+ utx.ut_addr = addr->sin_addr.s_addr;
+# endif
#endif /* defined(HAVE_UTMPX_H) && defined(USE_UTMPX) */
/*#if defined(HAVE_UTMPX_H) && defined(USE_UTMPX) && !defined(HAVE_LOGIN)*/