tags 517015 +pending
thanks

On Tue, Feb 24, 2009 at 08:48:35PM -0800, Mike Bird wrote:
> Package: e2fsprogs
> Version: 1.41.3-1
> Severity: minor
> 
> "tune2fs -m -1 /dev/foo" should be an error.

Thanks for reporting this bug.  I've committed a fix for this in the
git repository.

                                                - Ted

commit 8d8224550c1f5b5c77afbf5acd95f73979276a0a
Author: Theodore Ts'o <ty...@mit.edu>
Date:   Fri Mar 6 02:23:59 2009 -0500

    mke2fs, tune2fs: Do not allow the reserved_ratio to be negative
    
    Add a check to make sure the argument to the -m option (which
    specifies the reserved ratio) is greater than zero.
    
    Addresses-Debian-Bug: #517015
    
    Signed-off-by: "Theodore Ts'o" <ty...@mit.edu>

diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index 746d973..15948e0 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -1260,7 +1260,8 @@ static void PRS(int argc, char *argv[])
                        break;
                case 'm':
                        reserved_ratio = strtod(optarg, &tmp);
-                       if (reserved_ratio > 50 || *tmp) {
+                       if ( *tmp || reserved_ratio > 50 ||
+                            reserved_ratio < 0) {
                                com_err(program_name, 0,
                                        _("invalid reserved blocks percent - 
%s"),
                                        optarg);
diff --git a/misc/tune2fs.c b/misc/tune2fs.c
index 887a702..d779611 100644
--- a/misc/tune2fs.c
+++ b/misc/tune2fs.c
@@ -720,7 +720,8 @@ static void parse_tune2fs_options(int argc, char **argv)
                        break;
                case 'm':
                        reserved_ratio = strtod(optarg, &tmp);
-                       if (*tmp || reserved_ratio > 50) {
+                       if (*tmp || reserved_ratio > 50 ||
+                           reserved_ratio < 0) {
                                com_err(program_name, 0,
                                        _("bad reserved block ratio - %s"),
                                        optarg);



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to