DragonFly BSD
DragonFly commits List (threaded) for 2010-09
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

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


From: Sascha Wildner <swildner@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 30 Sep 2010 22:28:20 -0700 (PDT)

commit 82675d28343600f4e93f6bd6033ee829c2888c4e
Author: Sascha Wildner <saw@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



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