summaryrefslogtreecommitdiff
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
parentb2532b3be4133d2ea7bf6acaf2b0edb8217d356e (diff)
- Fill in ut_utaddr utmp field. Report from Benjamin Charron
<iretd@bigfoot.com>
-rw-r--r--ChangeLog2
-rw-r--r--TODO14
-rw-r--r--acconfig.h6
-rw-r--r--configure.in10
-rw-r--r--login.c8
5 files changed, 39 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index d36fbc079..9221ae962 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,8 @@
8 <Franz.Sirl-kernel@lauterbach.com> 8 <Franz.Sirl-kernel@lauterbach.com>
9 - Prevent typedefs from being compiled more than once. Report from 9 - Prevent typedefs from being compiled more than once. Report from
10 Marc G. Fournier <marc.fournier@acadiau.ca> 10 Marc G. Fournier <marc.fournier@acadiau.ca>
11 - Fill in ut_utaddr utmp field. Report from Benjamin Charron
12 <iretd@bigfoot.com>
11 13
1219991230 1419991230
13 - OpenBSD CVS updates: 15 - OpenBSD CVS updates:
diff --git a/TODO b/TODO
index ddd54621b..5d0ba5fd0 100644
--- a/TODO
+++ b/TODO
@@ -7,3 +7,17 @@
7- Replace the horror in acconfig.h which tries to comphensate for the 7- Replace the horror in acconfig.h which tries to comphensate for the
8 lack of u_intXX_t types. There must be a better way. 8 lack of u_intXX_t types. There must be a better way.
9 9
10- Hanging on logout:
11
12localhost$ ssh remotehost
13remotehost$ sleep 20 &
14remotehost$ logout
15(ssh hangs at logout for 20 seconds)
16
17Worse:
18
19localhost$ ssh root@remotehost
20remotehost# httpd
21remotehost# logout
22(ssh hangs at logout forever)
23
diff --git a/acconfig.h b/acconfig.h
index 3331a13f9..d0feb370d 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -43,6 +43,12 @@
43/* Define is utmpx.h has a ut_host field */ 43/* Define is utmpx.h has a ut_host field */
44#undef HAVE_HOST_IN_UTMPX 44#undef HAVE_HOST_IN_UTMPX
45 45
46/* Define is utmp.h has a ut_addr field */
47#undef HAVE_ADDR_IN_UTMP
48
49/* Define is utmpx.h has a ut_addr field */
50#undef HAVE_ADDR_IN_UTMPX
51
46/* Define is utmpx.h has a syslen field */ 52/* Define is utmpx.h has a syslen field */
47#undef HAVE_SYSLEN_IN_UTMPX 53#undef HAVE_SYSLEN_IN_UTMPX
48 54
diff --git a/configure.in b/configure.in
index dd3e16841..e9b2e69b0 100644
--- a/configure.in
+++ b/configure.in
@@ -325,6 +325,16 @@ AC_EGREP_HEADER(ut_id, utmp.h,
325 [AC_DEFINE(HAVE_ID_IN_UTMP) AC_MSG_RESULT(yes); ], 325 [AC_DEFINE(HAVE_ID_IN_UTMP) AC_MSG_RESULT(yes); ],
326 [AC_MSG_RESULT(no)] 326 [AC_MSG_RESULT(no)]
327) 327)
328AC_MSG_CHECKING([whether utmp.h has ut_addr field])
329AC_EGREP_HEADER(ut_addr, utmp.h,
330 [AC_DEFINE(HAVE_ADDR_IN_UTMP) AC_MSG_RESULT(yes); ],
331 [AC_MSG_RESULT(no)]
332)
333AC_MSG_CHECKING([whether utmpx.h has ut_addr field])
334AC_EGREP_HEADER(ut_addr, utmpx.h,
335 [AC_DEFINE(HAVE_ADDR_IN_UTMP) AC_MSG_RESULT(yes); ],
336 [AC_MSG_RESULT(no)]
337)
328 338
329dnl Look for lastlog location 339dnl Look for lastlog location
330AC_ARG_WITH(lastlog, 340AC_ARG_WITH(lastlog,
diff --git a/login.c b/login.c
index 5c58d814d..3dd208aa8 100644
--- a/login.c
+++ b/login.c
@@ -18,7 +18,7 @@
18 */ 18 */
19 19
20#include "includes.h" 20#include "includes.h"
21RCSID("$Id: login.c,v 1.15 1999/12/28 15:32:22 damien Exp $"); 21RCSID("$Id: login.c,v 1.16 1999/12/30 22:42:24 damien Exp $");
22 22
23#if defined(HAVE_UTMPX_H) && defined(USE_UTMPX) 23#if defined(HAVE_UTMPX_H) && defined(USE_UTMPX)
24# include <utmpx.h> 24# include <utmpx.h>
@@ -159,6 +159,9 @@ record_login(int pid, const char *ttyname, const char *user, uid_t uid,
159#if defined(HAVE_HOST_IN_UTMP) 159#if defined(HAVE_HOST_IN_UTMP)
160 strncpy(u.ut_host, host, sizeof(u.ut_host)); 160 strncpy(u.ut_host, host, sizeof(u.ut_host));
161#endif 161#endif
162#if defined(HAVE_ADDR_IN_UTMP)
163 u.ut_addr = addr->sin_addr.s_addr;
164#endif
162 165
163#if defined(HAVE_UTMPX_H) && defined(USE_UTMPX) 166#if defined(HAVE_UTMPX_H) && defined(USE_UTMPX)
164 memset(&utx, 0, sizeof(utx)); 167 memset(&utx, 0, sizeof(utx));
@@ -176,6 +179,9 @@ record_login(int pid, const char *ttyname, const char *user, uid_t uid,
176 strncpy(utx.ut_host, host, sizeof(utx.ut_host)); 179 strncpy(utx.ut_host, host, sizeof(utx.ut_host));
177# endif /* HAVE_SYSLEN_IN_UTMPX */ 180# endif /* HAVE_SYSLEN_IN_UTMPX */
178# endif 181# endif
182# if defined(HAVE_ADDR_IN_UTMPX)
183 utx.ut_addr = addr->sin_addr.s_addr;
184# endif
179#endif /* defined(HAVE_UTMPX_H) && defined(USE_UTMPX) */ 185#endif /* defined(HAVE_UTMPX_H) && defined(USE_UTMPX) */
180 186
181/*#if defined(HAVE_UTMPX_H) && defined(USE_UTMPX) && !defined(HAVE_LOGIN)*/ 187/*#if defined(HAVE_UTMPX_H) && defined(USE_UTMPX) && !defined(HAVE_LOGIN)*/