diff --git a/appl/ftp/ftpd/logwtmp.c b/appl/ftp/ftpd/logwtmp.c index 977e2f1fc..ab65395f8 100644 --- a/appl/ftp/ftpd/logwtmp.c +++ b/appl/ftp/ftpd/logwtmp.c @@ -87,7 +87,7 @@ ftpd_logwtmp(char *line, char *name, char *host) #endif memset(&ut, 0, sizeof(struct utmp)); -#ifdef HAVE_UT_TYPE +#ifdef HAVE_STRUCT_UTMP_UT_TYPE if(name[0]) ut.ut_type = USER_PROCESS; else @@ -95,10 +95,10 @@ ftpd_logwtmp(char *line, char *name, char *host) #endif strncpy(ut.ut_line, line, sizeof(ut.ut_line)); strncpy(ut.ut_name, name, sizeof(ut.ut_name)); -#ifdef HAVE_UT_PID +#ifdef HAVE_STRUCT_UTMP_UT_PID ut.ut_pid = getpid(); #endif -#ifdef HAVE_UT_HOST +#ifdef HAVE_STRUCT_UTMP_UT_HOST strncpy(ut.ut_host, host, sizeof(ut.ut_host)); #endif ut.ut_time = time(NULL); @@ -107,7 +107,7 @@ ftpd_logwtmp(char *line, char *name, char *host) strncpy(utx.ut_line, line, sizeof(utx.ut_line)); strncpy(utx.ut_user, name, sizeof(utx.ut_user)); strncpy(utx.ut_host, host, sizeof(utx.ut_host)); -#ifdef HAVE_UT_SYSLEN +#ifdef HAVE_STRUCT_UTMPX_UT_SYSLEN utx.ut_syslen = strlen(host) + 1; if (utx.ut_syslen > sizeof(utx.ut_host)) utx.ut_syslen = sizeof(utx.ut_host); diff --git a/appl/login/utmp_login.c b/appl/login/utmp_login.c index bc74126d4..b124ce639 100644 --- a/appl/login/utmp_login.c +++ b/appl/login/utmp_login.c @@ -50,11 +50,11 @@ prepare_utmp (struct utmp *utmp, char *tty, char *username, char *hostname) strncpy(utmp->ut_line, ttyx, sizeof(utmp->ut_line)); strncpy(utmp->ut_name, username, sizeof(utmp->ut_name)); -# ifdef HAVE_UT_USER +# ifdef HAVE_STRUCT_UTMP_UT_USER strncpy(utmp->ut_user, username, sizeof(utmp->ut_user)); # endif -# ifdef HAVE_UT_ADDR +# ifdef HAVE_STRUCT_UTMP_UT_ADDR if (hostname[0]) { struct hostent *he; if ((he = gethostbyname(hostname))) @@ -63,19 +63,19 @@ prepare_utmp (struct utmp *utmp, char *tty, char *username, char *hostname) } # endif -# ifdef HAVE_UT_HOST +# ifdef HAVE_STRUCT_UTMP_UT_HOST strncpy(utmp->ut_host, hostname, sizeof(utmp->ut_host)); # endif -# ifdef HAVE_UT_TYPE +# ifdef HAVE_STRUCT_UTMP_UT_TYPE utmp->ut_type = USER_PROCESS; # endif -# ifdef HAVE_UT_PID +# ifdef HAVE_STRUCT_UTMP_UT_PID utmp->ut_pid = getpid(); # endif -# ifdef HAVE_UT_ID +# ifdef HAVE_STRUCT_UTMP_UT_ID strncpy(utmp->ut_id, make_id(ttyx), sizeof(utmp->ut_id)); # endif } diff --git a/appl/login/utmpx_login.c b/appl/login/utmpx_login.c index d0631a6f6..48ab812b7 100644 --- a/appl/login/utmpx_login.c +++ b/appl/login/utmpx_login.c @@ -17,12 +17,12 @@ utmpx_update(struct utmpx *ut, char *line, char *user, char *host) char *clean_tty = clean_ttyname(line); strncpy(ut->ut_line, clean_tty, sizeof(ut->ut_line)); -#ifdef HAVE_UT_ID +#ifdef HAVE_STRUCT_UTMPX_UT_ID strncpy(ut->ut_id, make_id(clean_tty), sizeof(ut->ut_id)); #endif strncpy(ut->ut_user, user, sizeof(ut->ut_user)); strncpy(ut->ut_host, host, sizeof(ut->ut_host)); -#ifdef HAVE_UT_SYSLEN +#ifdef HAVE_STRUCT_UTMPX_UT_SYSLEN ut->ut_syslen = strlen(host) + 1; if (ut->ut_syslen > sizeof(ut->ut_host)) ut->ut_syslen = sizeof(ut->ut_host); diff --git a/appl/telnet/telnetd/sys_term.c b/appl/telnet/telnetd/sys_term.c index 10fa6be9b..cc6488237 100644 --- a/appl/telnet/telnetd/sys_term.c +++ b/appl/telnet/telnetd/sys_term.c @@ -53,7 +53,7 @@ struct utmpx wtmp; struct utmp wtmp; #endif /* HAVE_UTMPX_H */ -#ifdef HAVE_UT_HOST +#ifdef HAVE_STRUCT_UTMP_UT_HOST int utmp_len = sizeof(wtmp.ut_host); #else int utmp_len = MaxHostNameLen; @@ -1087,7 +1087,7 @@ clean_ttyname (char *tty) * Generate a name usable as an `ut_id', typically without `tty'. */ -#ifdef HAVE_UT_ID +#ifdef HAVE_STRUCT_UTMP_UT_ID static char * make_id (char *tty) { @@ -1265,7 +1265,7 @@ start_login(char *host, int autologin, char *name) memset(&utmpx, 0, sizeof(utmpx)); strncpy(utmpx.ut_user, ".telnet", sizeof(utmpx.ut_user)); strncpy(utmpx.ut_line, clean_tty, sizeof(utmpx.ut_line)); -#ifdef HAVE_UT_ID +#ifdef HAVE_STRUCT_UTMP_UT_ID strncpy(utmpx.ut_id, make_id(clean_tty), sizeof(utmpx.ut_id)); #endif utmpx.ut_pid = pid; @@ -1396,7 +1396,7 @@ rmut(void) if (utxp) { utxp->ut_user[0] = '\0'; utxp->ut_type = DEAD_PROCESS; -#ifdef HAVE_UT_EXIT +#ifdef HAVE_STRUCT_UTMPX_UT_EXIT #ifdef _STRUCT___EXIT_STATUS utxp->ut_exit.__e_termination = 0; utxp->ut_exit.__e_exit = 0; @@ -1420,7 +1420,7 @@ rmut(void) if (f >= 0) { strncpy(wtmp.ut_line, clean_tty, sizeof(wtmp.ut_line)); strncpy(wtmp.ut_name, "", sizeof(wtmp.ut_name)); -#ifdef HAVE_UT_HOST +#ifdef HAVE_STRUCT_UTMP_UT_HOST strncpy(wtmp.ut_host, "", sizeof(wtmp.ut_host)); #endif time(&wtmp.ut_time); @@ -1465,7 +1465,7 @@ rmut(void) continue; lseek(f, ((long)u)-((long)utmp), L_SET); strncpy(u->ut_name, "", sizeof(u->ut_name)); -#ifdef HAVE_UT_HOST +#ifdef HAVE_STRUCT_UTMP_UT_HOST strncpy(u->ut_host, "", sizeof(u->ut_host)); #endif time(&u->ut_time); @@ -1480,7 +1480,7 @@ rmut(void) if (f >= 0) { strncpy(wtmp.ut_line, clean_tty, sizeof(wtmp.ut_line)); strncpy(wtmp.ut_name, "", sizeof(wtmp.ut_name)); -#ifdef HAVE_UT_HOST +#ifdef HAVE_STRUCT_UTMP_UT_HOST strncpy(wtmp.ut_host, "", sizeof(wtmp.ut_host)); #endif time(&wtmp.ut_time);