summaryrefslogtreecommitdiffstats
path: root/crypto/openssh
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2002-07-11 10:36:10 +0000
committerdes <des@FreeBSD.org>2002-07-11 10:36:10 +0000
commit71869d2ebda5e6489892752d4cae3d53eea07e58 (patch)
tree590224ed64852299bcb1e13e2f540add509a336e /crypto/openssh
parentaa9de7efaeac14145ea4874f781d93b5545f9548 (diff)
downloadFreeBSD-src-71869d2ebda5e6489892752d4cae3d53eea07e58.zip
FreeBSD-src-71869d2ebda5e6489892752d4cae3d53eea07e58.tar.gz
Use realhostname_sa(3) so the IP address will be used instead of the
hostname if the latter is too long for utmp. Submitted by: ru MFC after: 3 days
Diffstat (limited to 'crypto/openssh')
-rw-r--r--crypto/openssh/loginrec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/openssh/loginrec.c b/crypto/openssh/loginrec.c
index 609e847..dfdf08a 100644
--- a/crypto/openssh/loginrec.c
+++ b/crypto/openssh/loginrec.c
@@ -164,6 +164,7 @@
#include "atomicio.h"
RCSID("$Id: loginrec.c,v 1.40 2002/04/23 13:09:19 djm Exp $");
+RCSID("$FreeBSD$");
#ifdef HAVE_UTIL_H
# include <util.h>
@@ -654,7 +655,8 @@ construct_utmp(struct logininfo *li,
/* Use strncpy because we don't necessarily want null termination */
strncpy(ut->ut_name, li->username, MIN_SIZEOF(ut->ut_name, li->username));
# ifdef HAVE_HOST_IN_UTMP
- strncpy(ut->ut_host, li->hostname, MIN_SIZEOF(ut->ut_host, li->hostname));
+ realhostname_sa(ut->ut_host, sizeof ut->ut_host,
+ &li->hostaddr.sa, li->hostaddr.sa.sa_len);
# endif
# ifdef HAVE_ADDR_IN_UTMP
/* this is just a 32-bit IP address */
OpenPOWER on IntegriCloud