summaryrefslogtreecommitdiffstats
path: root/crypto/openssh/loginrec.c
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2008-10-21 11:58:26 +0000
committerdes <des@FreeBSD.org>2008-10-21 11:58:26 +0000
commita9989b9d40bcea1318f2c3feff53b2025a0e2aae (patch)
treeb4bffbaae319cbf5567103987815c64ab9c0efa7 /crypto/openssh/loginrec.c
parentcc3d7dc928c727465328dba12b1c695b4f1cef1d (diff)
downloadFreeBSD-src-a9989b9d40bcea1318f2c3feff53b2025a0e2aae.zip
FreeBSD-src-a9989b9d40bcea1318f2c3feff53b2025a0e2aae.tar.gz
At some point, construct_utmp() was changed to use realhostname() to fill
in the struct utmp due to concerns about the length of the hostname buffer. However, this breaks the UseDNS option. There is a simpler and better solution: initialize utmp_len to the correct value (UT_HOSTSIZE instead of MAXHOSTNAMELEN) and let get_remote_name_or_ip() worry about the size of the buffer. PR: bin/97499 Submitted by: Bruce Cran <bruce@cran.org.uk> MFC after: 1 week
Diffstat (limited to 'crypto/openssh/loginrec.c')
-rw-r--r--crypto/openssh/loginrec.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/crypto/openssh/loginrec.c b/crypto/openssh/loginrec.c
index 6d90160..b411141 100644
--- a/crypto/openssh/loginrec.c
+++ b/crypto/openssh/loginrec.c
@@ -146,7 +146,6 @@
*/
#include "includes.h"
-__RCSID("$FreeBSD$");
#include <sys/types.h>
#include <sys/stat.h>
@@ -689,8 +688,8 @@ construct_utmp(struct logininfo *li,
strncpy(ut->ut_name, li->username,
MIN_SIZEOF(ut->ut_name, li->username));
# ifdef HAVE_HOST_IN_UTMP
- realhostname_sa(ut->ut_host, sizeof ut->ut_host,
- &li->hostaddr.sa, li->hostaddr.sa.sa_len);
+ strncpy(ut->ut_host, li->hostname,
+ MIN_SIZEOF(ut->ut_host, li->hostname));
# endif
# ifdef HAVE_ADDR_IN_UTMP
/* this is just a 32-bit IP address */
OpenPOWER on IntegriCloud