NetBSD-Bugs archive

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

bin/41490: fsck_ext2fs doesn't ignore the -P flag



>Number:         41490
>Category:       bin
>Synopsis:       fsck_ext2fs doesn't ignore the -P flag
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 25 23:00:00 +0000 2009
>Originator:     khorben%syn.defora.rom@localhost
>Release:        NetBSD 5.0_STABLE
>Organization:
>Environment:
System: NetBSD syn.defora.rom 5.0_STABLE NetBSD 5.0_STABLE (GENERIC) #9: Sun 
May 24 17:14:35 CEST 2009 
khorben%syn.defora.rom@localhost:/usr/obj/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
In src/sbin/fsck_ext2fs/main.c, the -P flag is meant to be ignored, even though 
it is not implemented:

142                 case 'P':
143                         /* Progress meter not implemented. */
144                         break;

This is probably to allow setting "fsck_flags=-pP" in /etc/rc.conf nonetheless, 
as I like to do myself. However, getopt() is not aware of this:

110         while ((ch = getopt(argc, argv, "b:dfm:npqUy")) != -1) {

>How-To-Repeat:

$ fsck_ext2fs -P
fsck_ext2fs: unknown option -- P
usage: fsck_ext2fs [-dfnpUy] [-b block] [-c level] [-m mode] filesystem ...

>Fix:

Apply this patch:

Index: main.c
===================================================================
RCS file: /cvsroot/src/sbin/fsck_ext2fs/main.c,v
retrieving revision 1.32
diff -p -u -r1.32 main.c
--- main.c      12 Oct 2008 20:49:43 -0000      1.32
+++ main.c      25 May 2009 21:35:19 -0000
@@ -107,7 +107,7 @@ main(int argc, char *argv[])
 
        sync();
        skipclean = 1;
-       while ((ch = getopt(argc, argv, "b:dfm:npqUy")) != -1) {
+       while ((ch = getopt(argc, argv, "b:dfm:npPqUy")) != -1) {
                switch (ch) {
                case 'b':
                        skipclean = 0;



Home | Main Index | Thread Index | Old Index