From owner-freebsd-current@FreeBSD.ORG Sat Jun 30 07:36:58 2007 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 607A316A400 for ; Sat, 30 Jun 2007 07:36:58 +0000 (UTC) (envelope-from dunstan@freebsd.czest.pl) Received: from freebsd.czest.pl (freebsd.czest.pl [80.48.250.4]) by mx1.freebsd.org (Postfix) with ESMTP id DE2F613C458 for ; Sat, 30 Jun 2007 07:36:57 +0000 (UTC) (envelope-from dunstan@freebsd.czest.pl) Received: from freebsd.czest.pl (freebsd.czest.pl [80.48.250.4]) by freebsd.czest.pl (8.13.4/8.12.9) with ESMTP id l5U8FJO0079053; Sat, 30 Jun 2007 08:15:20 GMT (envelope-from dunstan@freebsd.czest.pl) Received: (from dunstan@localhost) by freebsd.czest.pl (8.13.4/8.12.9/Submit) id l5U8FI9c079052; Sat, 30 Jun 2007 08:15:18 GMT (envelope-from dunstan) Date: Sat, 30 Jun 2007 08:15:17 +0000 From: "Wojciech A. Koszek" To: Danny Braniss Message-ID: <20070630081517.GA79001@FreeBSD.czest.pl> Mail-Followup-To: "Wojciech A. Koszek" , Danny Braniss , freebsd-current@freebsd.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i X-Greylist: Sender DNS name whitelisted, not delayed by milter-greylist-2.0.2 (freebsd.czest.pl [80.48.250.4]); Sat, 30 Jun 2007 08:15:20 +0000 (UTC) Cc: freebsd-current@freebsd.org Subject: Re: INCLUDE_CONFIG_FILE off-by-one problem X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jun 2007 07:36:58 -0000 On Sat, Jun 30, 2007 at 09:00:13AM +0300, Danny Braniss wrote: > > On Wed, Jun 06, 2007 at 10:18:40AM +0300, Danny Braniss wrote: > > > to get the config file from the kernel, one can use config -k, which > > > executes elfdump to get the offset and size. The size is actually 1(one) > > > byte too big, and so the output of config -k contains a NULL/0/^@ as > > > the last byte. I think the problem is in the elf file. > > > > Why do you think that the problem lies in the ELF file? > the size is wrongly reported. Hm. Not sure which notion of size you mean in this context. Configuration file is basically pretty standard sysctl, from which it's exported. > > > > > Can you confirm that following sysctls: > > > > kern.geom.confxml > > kern.geom.conftxt > > > > don't suffer from the same problem? > they are both empty. (and yes, geom_label is loaded). They're not related with GEOM_LABEL. I belive you haven't used -b flag while trying to see their contents. If you try: sysctl -b kern.geom.confxml or sysctl -b kern.geom.conftxt You'll notice these sysctls also contain NULL byte at the end, and they both suffer from being recognized as a binary files, while piped to grep(1). I'll look into this. If the kernel side of this interface is correct, I'm going to simply modify config(8) to skip the last byte of the output. Thanks for the report, -- Wojciech A. Koszek wkoszek@FreeBSD.org http://FreeBSD.czest.pl/dunstan/