From owner-freebsd-audit Wed Mar 7 10:12: 1 2001 Delivered-To: freebsd-audit@freebsd.org Received: from mx.nsu.ru (mx.nsu.ru [193.124.215.71]) by hub.freebsd.org (Postfix) with ESMTP id CAB0A37B719; Wed, 7 Mar 2001 10:11:50 -0800 (PST) (envelope-from fjoe@iclub.nsu.ru) Received: from iclub.nsu.ru (root@iclub.nsu.ru [193.124.222.66]) by mx.nsu.ru (8.9.1/8.9.0) with ESMTP id AAA16275; Thu, 8 Mar 2001 00:09:09 +0600 (NOVT) Received: from localhost (fjoe@localhost) by iclub.nsu.ru (8.11.2/8.11.2) with ESMTP id f27I97V47594; Thu, 8 Mar 2001 00:09:08 +0600 (NS) (envelope-from fjoe@iclub.nsu.ru) Date: Thu, 8 Mar 2001 00:09:06 +0600 (NS) From: Max Khon To: Ruslan Ermilov Cc: freebsd-audit@FreeBSD.ORG, Garrett Wollman Subject: Re: MAXHOSTNAMELEN In-Reply-To: <20010307183125.A3227@sunbay.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG hi, there! On Wed, 7 Mar 2001, Ruslan Ermilov wrote: > > And given that MAXHOSTNAMELEN is defined as 256, it would appear that > > passing MAXHOSTNAMELEN would be enough. But we are not currently > > POSIX-compatible; kern_mib.c defines ``char hostname[MAXHOSTNAMELEN]'' > > thus allowing host names of up to 256 bytes, so (in FreeBSD), you > > should pass MAXHOSTNAMELEN+1. > > > > This could be fixed by redefining MAXHOSTNAMELEN to 255. Garrett? > > > Grr, I meant to say that you should always pass MAXHOSTNAMELEN+1, but > the current value of MAXHOSTNAMELEN is not POSIX-compatible. so in a lot of places buffers that supposed to hold hostname are not allocated properly (see output of grep in my original message) /fjoe To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message