From owner-freebsd-bugs@FreeBSD.ORG Mon Mar 31 21:00:07 2008 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DA271065679 for ; Mon, 31 Mar 2008 21:00:07 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 6FDC08FC20 for ; Mon, 31 Mar 2008 21:00:07 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m2VL07SJ013482 for ; Mon, 31 Mar 2008 21:00:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m2VL07SX013481; Mon, 31 Mar 2008 21:00:07 GMT (envelope-from gnats) Date: Mon, 31 Mar 2008 21:00:07 GMT Message-Id: <200803312100.m2VL07SX013481@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Bruce Cran Cc: Subject: Re: bin/97499: one of sshd_config(5) options does not work X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Bruce Cran List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Mar 2008 21:00:07 -0000 The following reply was made to PR bin/97499; it has been noted by GNATS. From: Bruce Cran To: bug-followup@FreeBSD.org, arnoldlee_chn@yahoo.com Cc: Subject: Re: bin/97499: one of sshd_config(5) options does not work Date: Mon, 31 Mar 2008 21:58:31 +0100 This is a multi-part message in MIME format. --------------020704090400020909060705 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit The attached patches should fix the problem. There are other places in the code where MAXHOSTNAMELEN is used instead of UT_HOSTSIZE but unless the user overrides utmp_len with the -u command-line switch the existing behaviour will be retained. --------------020704090400020909060705 Content-Type: text/plain; name="loginrec.c.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="loginrec.c.diff" --- /usr/src/crypto/openssh/loginrec.c 2006-09-30 14:38:04.000000000 +0100 +++ loginrec.c 2008-03-31 21:45:37.000000000 +0100 @@ -688,8 +688,8 @@ 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 */ --------------020704090400020909060705 Content-Type: text/plain; name="sshd.c.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="sshd.c.diff" --- /usr/src/crypto/openssh/sshd.c 2006-11-10 16:52:41.000000000 +0000 +++ sshd.c 2008-03-31 21:45:41.000000000 +0100 @@ -71,6 +71,7 @@ #include #include #include +#include #include #include @@ -235,7 +236,7 @@ u_int session_id2_len = 0; /* record remote hostname or ip */ -u_int utmp_len = MAXHOSTNAMELEN; +u_int utmp_len = UT_HOSTSIZE; /* options.max_startup sized array of fd ints */ int *startup_pipes = NULL; --------------020704090400020909060705--