Bug#517015: e2fsprogs: tune2fs accept negative reserved blocks percentage

2009-03-05 Thread Theodore Tso
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



Bug#517015: e2fsprogs: tune2fs accept negative reserved blocks percentage

2009-02-24 Thread Mike Bird
Package: e2fsprogs
Version: 1.41.3-1
Severity: minor


tune2fs -m -1 /dev/foo should be an error.

-- System Information:
Debian Release: 5.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-1-686 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages e2fsprogs depends on:
ii  e2fslibs  1.41.3-1   ext2 filesystem libraries
ii  libblkid1 1.41.3-1   block device id library
ii  libc6 2.7-18 GNU C Library: Shared libraries
ii  libcomerr21.41.3-1   common error description library
ii  libss21.41.3-1   command-line interface parsing lib
ii  libuuid1  1.41.3-1   universally unique id library

e2fsprogs recommends no packages.

Versions of packages e2fsprogs suggests:
pn  e2fsck-static  none(no description available)
pn  gpart  none(no description available)
ii  parted 1.8.8.git.2008.03.24-11.1 The GNU Parted disk partition resi

-- no debconf information



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