[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#519172: [jbowler@acm.org: RE: Test images for Debian lenny rc2 available]



More background info:

----- Forwarded message from John Bowler <jbowler@acm.org> -----

From: John Bowler <jbowler@acm.org>
Reply-To: jbowler@acm.org
Subject: RE: Test images for Debian lenny rc2 available
Date: Tue, 10 Mar 2009 10:52:28 -0700
To: 'Martin Michlmayr' <tbm@cyrius.com>
Cc: 'Marc Singer' <elf@buici.com>, 'Rod Whitby' <rod@whitby.id.au>
X-Mailer: Microsoft Office Outlook 12.0
X-Originating-IP: 74.32.171.36

Try this - it avoids executing devio twice:

sysconf=$(devio "<<$1" '!?b.$4->' cp)

You should get an empty $sysconf (and the whole command will fail with exit
code 1) when it is uninitialized and a correct copy with a "\n" appended for
safety if it is ok.

devio doesn't check the whole length before it reads - it just reads in
blocks - so what is happening at present is that your 'sysconf' variable
ends up 130048 characters long, full of 0xff bytes.  If you make the above
change it quietly rejects any SysConf where the byte count is more than
131068.  You might have one somewhere if somehow someone zapped the first
four bytes on an otherwise ok SysConf, but it's probably the right thing to
reject it if that happened.

John Bowler <jbowler@acm.org>

-----Original Message-----
From: Martin Michlmayr [mailto:tbm@cyrius.com] 
Sent: Tuesday, March 10, 2009 1:28 AM
To: John Bowler
Cc: 'Marc Singer'; 'Rod Whitby'
Subject: Re: Test images for Debian lenny rc2 available

* John Bowler <jbowler@acm.org> [2009-03-09 15:51]:
> I'm looking at line 65 of /etc/init.0/sysconfsetup, if you're still using
> that, and it says (on my very old Slug):

No, we're talking about a tool in Debian here, which merely does
    sysconf=$(devio "<<$1" cpb)
to read the sysconf partition.

> I think that all it needs to do is check the length first:
> 
>         devio "<<$sysdev" '!? b$4->' && devio "<<$sysdev" cpb fb1,10 |
> {horrible sed command}
> I.e. check the length to ensure it is not greater than the device
length-4.

That seems to work for me.

So is this the correct fix?
-- 
Martin Michlmayr
http://www.cyrius.com/

----- End forwarded message -----

-- 
Martin Michlmayr
http://www.cyrius.com/



Reply to: