Changeset View
Changeset View
Standalone View
Standalone View
loginrec.c
Show First 20 Lines • Show All 150 Lines • ▼ Show 20 Lines | |||||
#include <sys/stat.h> | #include <sys/stat.h> | ||||
#include <sys/socket.h> | #include <sys/socket.h> | ||||
#ifdef HAVE_SYS_TIME_H | #ifdef HAVE_SYS_TIME_H | ||||
# include <sys/time.h> | # include <sys/time.h> | ||||
#endif | #endif | ||||
#include <netinet/in.h> | #include <netinet/in.h> | ||||
#include <stdlib.h> | |||||
#include <errno.h> | #include <errno.h> | ||||
#include <fcntl.h> | #include <fcntl.h> | ||||
#ifdef HAVE_PATHS_H | #ifdef HAVE_PATHS_H | ||||
# include <paths.h> | # include <paths.h> | ||||
#endif | #endif | ||||
#include <pwd.h> | #include <pwd.h> | ||||
#include <stdarg.h> | #include <stdarg.h> | ||||
#include <stdio.h> | |||||
#include <string.h> | #include <string.h> | ||||
#include <time.h> | #include <time.h> | ||||
#include <unistd.h> | #include <unistd.h> | ||||
#include "xmalloc.h" | #include "xmalloc.h" | ||||
#include "sshkey.h" | #include "sshkey.h" | ||||
#include "hostfile.h" | #include "hostfile.h" | ||||
#include "ssh.h" | #include "ssh.h" | ||||
▲ Show 20 Lines • Show All 596 Lines • ▼ Show 20 Lines | # endif | ||||
/* | /* | ||||
* These fields are only used when logging in, and are blank | * These fields are only used when logging in, and are blank | ||||
* for logouts. | * for logouts. | ||||
*/ | */ | ||||
# ifdef HAVE_HOST_IN_UTMPX | # ifdef HAVE_HOST_IN_UTMPX | ||||
strncpy(utx->ut_host, li->hostname, | strncpy(utx->ut_host, li->hostname, | ||||
MIN_SIZEOF(utx->ut_host, li->hostname)); | MIN_SIZEOF(utx->ut_host, li->hostname)); | ||||
# endif | |||||
# ifdef HAVE_SS_IN_UTMPX | |||||
utx->ut_ss = li->hostaddr.sa_storage; | |||||
# endif | # endif | ||||
# ifdef HAVE_ADDR_IN_UTMPX | # ifdef HAVE_ADDR_IN_UTMPX | ||||
/* this is just a 32-bit IP address */ | /* this is just a 32-bit IP address */ | ||||
if (li->hostaddr.sa.sa_family == AF_INET) | if (li->hostaddr.sa.sa_family == AF_INET) | ||||
utx->ut_addr = li->hostaddr.sa_in.sin_addr.s_addr; | utx->ut_addr = li->hostaddr.sa_in.sin_addr.s_addr; | ||||
# endif | # endif | ||||
# ifdef HAVE_ADDR_V6_IN_UTMP | # ifdef HAVE_ADDR_V6_IN_UTMP | ||||
/* this is just a 128-bit IPv6 address */ | /* this is just a 128-bit IPv6 address */ | ||||
▲ Show 20 Lines • Show All 939 Lines • Show Last 20 Lines |