HAVE_UT_* -> HAVE_STRUCT_UTMP*_UT_*
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@5458 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -87,7 +87,7 @@ ftpd_logwtmp(char *line, char *name, char *host)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
memset(&ut, 0, sizeof(struct utmp));
|
memset(&ut, 0, sizeof(struct utmp));
|
||||||
#ifdef HAVE_UT_TYPE
|
#ifdef HAVE_STRUCT_UTMP_UT_TYPE
|
||||||
if(name[0])
|
if(name[0])
|
||||||
ut.ut_type = USER_PROCESS;
|
ut.ut_type = USER_PROCESS;
|
||||||
else
|
else
|
||||||
@@ -95,10 +95,10 @@ ftpd_logwtmp(char *line, char *name, char *host)
|
|||||||
#endif
|
#endif
|
||||||
strncpy(ut.ut_line, line, sizeof(ut.ut_line));
|
strncpy(ut.ut_line, line, sizeof(ut.ut_line));
|
||||||
strncpy(ut.ut_name, name, sizeof(ut.ut_name));
|
strncpy(ut.ut_name, name, sizeof(ut.ut_name));
|
||||||
#ifdef HAVE_UT_PID
|
#ifdef HAVE_STRUCT_UTMP_UT_PID
|
||||||
ut.ut_pid = getpid();
|
ut.ut_pid = getpid();
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_UT_HOST
|
#ifdef HAVE_STRUCT_UTMP_UT_HOST
|
||||||
strncpy(ut.ut_host, host, sizeof(ut.ut_host));
|
strncpy(ut.ut_host, host, sizeof(ut.ut_host));
|
||||||
#endif
|
#endif
|
||||||
ut.ut_time = time(NULL);
|
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_line, line, sizeof(utx.ut_line));
|
||||||
strncpy(utx.ut_user, name, sizeof(utx.ut_user));
|
strncpy(utx.ut_user, name, sizeof(utx.ut_user));
|
||||||
strncpy(utx.ut_host, host, sizeof(utx.ut_host));
|
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;
|
utx.ut_syslen = strlen(host) + 1;
|
||||||
if (utx.ut_syslen > sizeof(utx.ut_host))
|
if (utx.ut_syslen > sizeof(utx.ut_host))
|
||||||
utx.ut_syslen = sizeof(utx.ut_host);
|
utx.ut_syslen = sizeof(utx.ut_host);
|
||||||
|
@@ -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_line, ttyx, sizeof(utmp->ut_line));
|
||||||
strncpy(utmp->ut_name, username, sizeof(utmp->ut_name));
|
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));
|
strncpy(utmp->ut_user, username, sizeof(utmp->ut_user));
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# ifdef HAVE_UT_ADDR
|
# ifdef HAVE_STRUCT_UTMP_UT_ADDR
|
||||||
if (hostname[0]) {
|
if (hostname[0]) {
|
||||||
struct hostent *he;
|
struct hostent *he;
|
||||||
if ((he = gethostbyname(hostname)))
|
if ((he = gethostbyname(hostname)))
|
||||||
@@ -63,19 +63,19 @@ prepare_utmp (struct utmp *utmp, char *tty, char *username, char *hostname)
|
|||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# ifdef HAVE_UT_HOST
|
# ifdef HAVE_STRUCT_UTMP_UT_HOST
|
||||||
strncpy(utmp->ut_host, hostname, sizeof(utmp->ut_host));
|
strncpy(utmp->ut_host, hostname, sizeof(utmp->ut_host));
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# ifdef HAVE_UT_TYPE
|
# ifdef HAVE_STRUCT_UTMP_UT_TYPE
|
||||||
utmp->ut_type = USER_PROCESS;
|
utmp->ut_type = USER_PROCESS;
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# ifdef HAVE_UT_PID
|
# ifdef HAVE_STRUCT_UTMP_UT_PID
|
||||||
utmp->ut_pid = getpid();
|
utmp->ut_pid = getpid();
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# ifdef HAVE_UT_ID
|
# ifdef HAVE_STRUCT_UTMP_UT_ID
|
||||||
strncpy(utmp->ut_id, make_id(ttyx), sizeof(utmp->ut_id));
|
strncpy(utmp->ut_id, make_id(ttyx), sizeof(utmp->ut_id));
|
||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
|
@@ -17,12 +17,12 @@ utmpx_update(struct utmpx *ut, char *line, char *user, char *host)
|
|||||||
char *clean_tty = clean_ttyname(line);
|
char *clean_tty = clean_ttyname(line);
|
||||||
|
|
||||||
strncpy(ut->ut_line, clean_tty, sizeof(ut->ut_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));
|
strncpy(ut->ut_id, make_id(clean_tty), sizeof(ut->ut_id));
|
||||||
#endif
|
#endif
|
||||||
strncpy(ut->ut_user, user, sizeof(ut->ut_user));
|
strncpy(ut->ut_user, user, sizeof(ut->ut_user));
|
||||||
strncpy(ut->ut_host, host, sizeof(ut->ut_host));
|
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;
|
ut->ut_syslen = strlen(host) + 1;
|
||||||
if (ut->ut_syslen > sizeof(ut->ut_host))
|
if (ut->ut_syslen > sizeof(ut->ut_host))
|
||||||
ut->ut_syslen = sizeof(ut->ut_host);
|
ut->ut_syslen = sizeof(ut->ut_host);
|
||||||
|
@@ -53,7 +53,7 @@ struct utmpx wtmp;
|
|||||||
struct utmp wtmp;
|
struct utmp wtmp;
|
||||||
#endif /* HAVE_UTMPX_H */
|
#endif /* HAVE_UTMPX_H */
|
||||||
|
|
||||||
#ifdef HAVE_UT_HOST
|
#ifdef HAVE_STRUCT_UTMP_UT_HOST
|
||||||
int utmp_len = sizeof(wtmp.ut_host);
|
int utmp_len = sizeof(wtmp.ut_host);
|
||||||
#else
|
#else
|
||||||
int utmp_len = MaxHostNameLen;
|
int utmp_len = MaxHostNameLen;
|
||||||
@@ -1087,7 +1087,7 @@ clean_ttyname (char *tty)
|
|||||||
* Generate a name usable as an `ut_id', typically without `tty'.
|
* Generate a name usable as an `ut_id', typically without `tty'.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_UT_ID
|
#ifdef HAVE_STRUCT_UTMP_UT_ID
|
||||||
static char *
|
static char *
|
||||||
make_id (char *tty)
|
make_id (char *tty)
|
||||||
{
|
{
|
||||||
@@ -1265,7 +1265,7 @@ start_login(char *host, int autologin, char *name)
|
|||||||
memset(&utmpx, 0, sizeof(utmpx));
|
memset(&utmpx, 0, sizeof(utmpx));
|
||||||
strncpy(utmpx.ut_user, ".telnet", sizeof(utmpx.ut_user));
|
strncpy(utmpx.ut_user, ".telnet", sizeof(utmpx.ut_user));
|
||||||
strncpy(utmpx.ut_line, clean_tty, sizeof(utmpx.ut_line));
|
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));
|
strncpy(utmpx.ut_id, make_id(clean_tty), sizeof(utmpx.ut_id));
|
||||||
#endif
|
#endif
|
||||||
utmpx.ut_pid = pid;
|
utmpx.ut_pid = pid;
|
||||||
@@ -1396,7 +1396,7 @@ rmut(void)
|
|||||||
if (utxp) {
|
if (utxp) {
|
||||||
utxp->ut_user[0] = '\0';
|
utxp->ut_user[0] = '\0';
|
||||||
utxp->ut_type = DEAD_PROCESS;
|
utxp->ut_type = DEAD_PROCESS;
|
||||||
#ifdef HAVE_UT_EXIT
|
#ifdef HAVE_STRUCT_UTMPX_UT_EXIT
|
||||||
#ifdef _STRUCT___EXIT_STATUS
|
#ifdef _STRUCT___EXIT_STATUS
|
||||||
utxp->ut_exit.__e_termination = 0;
|
utxp->ut_exit.__e_termination = 0;
|
||||||
utxp->ut_exit.__e_exit = 0;
|
utxp->ut_exit.__e_exit = 0;
|
||||||
@@ -1420,7 +1420,7 @@ rmut(void)
|
|||||||
if (f >= 0) {
|
if (f >= 0) {
|
||||||
strncpy(wtmp.ut_line, clean_tty, sizeof(wtmp.ut_line));
|
strncpy(wtmp.ut_line, clean_tty, sizeof(wtmp.ut_line));
|
||||||
strncpy(wtmp.ut_name, "", sizeof(wtmp.ut_name));
|
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));
|
strncpy(wtmp.ut_host, "", sizeof(wtmp.ut_host));
|
||||||
#endif
|
#endif
|
||||||
time(&wtmp.ut_time);
|
time(&wtmp.ut_time);
|
||||||
@@ -1465,7 +1465,7 @@ rmut(void)
|
|||||||
continue;
|
continue;
|
||||||
lseek(f, ((long)u)-((long)utmp), L_SET);
|
lseek(f, ((long)u)-((long)utmp), L_SET);
|
||||||
strncpy(u->ut_name, "", sizeof(u->ut_name));
|
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));
|
strncpy(u->ut_host, "", sizeof(u->ut_host));
|
||||||
#endif
|
#endif
|
||||||
time(&u->ut_time);
|
time(&u->ut_time);
|
||||||
@@ -1480,7 +1480,7 @@ rmut(void)
|
|||||||
if (f >= 0) {
|
if (f >= 0) {
|
||||||
strncpy(wtmp.ut_line, clean_tty, sizeof(wtmp.ut_line));
|
strncpy(wtmp.ut_line, clean_tty, sizeof(wtmp.ut_line));
|
||||||
strncpy(wtmp.ut_name, "", sizeof(wtmp.ut_name));
|
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));
|
strncpy(wtmp.ut_host, "", sizeof(wtmp.ut_host));
|
||||||
#endif
|
#endif
|
||||||
time(&wtmp.ut_time);
|
time(&wtmp.ut_time);
|
||||||
|
Reference in New Issue
Block a user