Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Jun 2007 11:01:30 +0300
From:      Danny Braniss <danny@cs.huji.ac.il>
To:        "Wojciech A. Koszek" <wkoszek@freebsd.org>
Cc:        freebsd-current@freebsd.org
Subject:   Re: INCLUDE_CONFIG_FILE off-by-one problem 
Message-ID:  <E1I4Xta-000805-Rz@cs1.cs.huji.ac.il>
In-Reply-To: Your message of Sat, 30 Jun 2007 08:15:17 %2B0000 .

next in thread | raw e-mail | index | archive | help
> 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.

ok, so here is the output, and it seems bad under 6.2 too.
bsd> sysctl -b kern.geom.confxml | cat -v|tail
      <rank>4</rank>
        <consumer id="0xffffff00ac73fd00">
          <geom ref="0xffffff00ac999900"/>
          <provider ref="0xffffff00ac591500"/>
          <mode>r1w1e1</mode>
        </consumer>
    </geom>
  </class>
</mesh>
^@bsd> 
^
|
+------ the extra null
> 
> Thanks for the report,
thank you!
	danny





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E1I4Xta-000805-Rz>