conf/126386: NANO_MEDIASIZE overflow
Mark A
mark at genre121.com
Sat Aug 9 00:00:14 UTC 2008
>Number: 126386
>Category: conf
>Synopsis: NANO_MEDIASIZE overflow
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sat Aug 09 00:00:13 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator: Mark A
>Release: FreeBSD 7.0-RELEASE-p2 i386
>Organization:
>Environment:
System: FreeBSD mail.genre121.com 7.0-RELEASE-p2 FreeBSD 7.0-RELEASE-p2 #0: Thu Jul 17 02:11:59 MDT 2008 mark at mail.genre121.com:/usr/obj/usr/src/sys/MAIL i386
>Description:
In /usr/src/tools/tools/nanobsd/FlashDevice.sub there are 2 lines
in question...
NANO_MEDIASIZE=`expr 4097802240 / 512`
NANO_MEDIASIZE=`expr 4224761856 / 512`
Those result with...
expr 4097802240 / 512
4194303
expr 4224761856 / 512
4194303
>How-To-Repeat:
Include "FlashDevice Sandisk 4g" in your nanobsd configuration
file.
Insert a few debugging print statements in nanobsd.sh where
NANO_MEDIASIZE is used.
When "/bin/sh nanobsd.sh -c nanobsd.conf" is run $NANO_MEDIASIZE
always prints 4194303.
>Fix:
Use expr -e
expr -e 4097802240 / 512
8003520
expr -e 4224761856 / 512
8251488
The man page for expr also states that if EXPR_COMPAT is
set then expr -e is used.
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list