summaryrefslogtreecommitdiff
path: root/login.c
diff options
context:
space:
mode:
Diffstat (limited to 'login.c')
-rw-r--r--login.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/login.c b/login.c
index c551da898..f4e6ddfaf 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.11 1999/12/24 23:11:29 damien Exp $"); 21RCSID("$Id: login.c,v 1.12 1999/12/25 23:21:48 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>
@@ -155,18 +155,19 @@ record_login(int pid, const char *ttyname, const char *user, uid_t uid,
155 strncpy(utx.ut_line, ttyname + 5, sizeof(utx.ut_line)); 155 strncpy(utx.ut_line, ttyname + 5, sizeof(utx.ut_line));
156 utx.ut_pid = (pid_t)pid; 156 utx.ut_pid = (pid_t)pid;
157 utx.ut_tv.tv_sec = time(NULL); 157 utx.ut_tv.tv_sec = time(NULL);
158 u.ut_type = (uid == -1)?DEAD_PROCESS:USER_PROCESS; 158 utx.ut_type = (uid == -1)?DEAD_PROCESS:USER_PROCESS;
159#ifdef HAVE_HOST_IN_UTMPX 159# ifdef HAVE_HOST_IN_UTMPX
160#ifdef HAVE_SYSLEN_IN_UTMPX 160# ifdef HAVE_SYSLEN_IN_UTMPX
161 utx.ut_syslen = strlen(host); 161 utx.ut_syslen = strlen(host);
162 strncpy(utx.ut_host, host, utx.ut_syslen ); 162 strncpy(utx.ut_host, host, utx.ut_syslen);
163#else 163# else
164 strncpy(utx.ut_host, host, sizeof(utx.ut_host)); 164 strncpy(utx.ut_host, host, sizeof(utx.ut_host));
165#endif /* HAVE_SYSLEN_IN_UTMPX */ 165# endif /* HAVE_SYSLEN_IN_UTMPX */
166#endif 166# endif
167#endif /* defined(HAVE_UTMPX_H) && defined(USE_UTMPX) */ 167#endif /* defined(HAVE_UTMPX_H) && defined(USE_UTMPX) */
168 168
169#if defined(HAVE_UTMPX_H) && defined(USE_UTMPX) && !defined(HAVE_LOGIN) 169/*#if defined(HAVE_UTMPX_H) && defined(USE_UTMPX) && !defined(HAVE_LOGIN)*/
170#if defined(HAVE_UTMPX_H) && defined(USE_UTMPX)
170 login(&u, &utx); 171 login(&u, &utx);
171#else /* defined(HAVE_UTMPX_H) && defined(USE_UTMPX) */ 172#else /* defined(HAVE_UTMPX_H) && defined(USE_UTMPX) */
172 login(&u); 173 login(&u);