git: fdisk(8): Fix a bug when reading >1TB slice sizes from a config file.

Sascha Wildner swildner at crater.dragonflybsd.org
Thu Sep 30 22:29:30 PDT 2010


commit 82675d28343600f4e93f6bd6033ee829c2888c4e
Author: Sascha Wildner <saw at online.de>
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(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/82675d28343600f4e93f6bd6033ee829c2888c4e


-- 
DragonFly BSD source repository





More information about the Commits mailing list