aboutsummaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2002-07-11 10:36:10 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2002-07-11 10:36:10 +0000
commita9f7d76b966fe60e964089ce091784061e7deb4f (patch)
tree590224ed64852299bcb1e13e2f540add509a336e /crypto
parenta3ee32f3f72b616867d19e5abbd1ebd4d3ae1052 (diff)
downloadsrc-a9f7d76b966fe60e964089ce091784061e7deb4f.tar.gz
src-a9f7d76b966fe60e964089ce091784061e7deb4f.zip
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
Notes
Notes: svn path=/head/; revision=99768
Diffstat (limited to 'crypto')
-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 609e84768c41..dfdf08a3766d 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 */