DragonFly commits List (threaded) for 2010-09
git: fdisk(8): Fix a bug when reading >1TB slice sizes from a config file.
Author: Sascha Wildner <firstname.lastname@example.org>
Date: Fri Oct 1 07:24:20 2010 +0200
fdisk(8): Fix a bug when reading >1TB slice sizes from a config file.
The numerical parameters in configuration file lines were previously
read into signed integers. This would cause a problem with a config
file line like this (for a ~1.2TB slice):
p 1 165 63 2491404993
The length parameter (2491404993) for the slice would have exceeded
INT_MAX (2147483647) and the slice would have been truncated to 1TB.
Since the installer is using fdisk with a configuration file, it
was previously not possible to use a whole >1TB disk from it (one
had to work around it from the command line).
To fix all this, read the numerical parameters in configuration file
lines into a long long.
Note that this change only affects the variable type into which the
parameters read from the file are stored and not any on-disk structures.
Also, checks at different places in fdisk(8) will of course still ensure
that we don't ever go above 2TB.
Summary of changes:
sbin/fdisk/fdisk.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
DragonFly BSD source repository