NetBSD Problem Report #41490

From khorben@syn.defora.rom  Mon May 25 22:59:19 2009
Return-Path: <khorben@syn.defora.rom>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 959F863B11D
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 25 May 2009 22:59:19 +0000 (UTC)
Message-Id: <20090525213907.CB3D65490@syn.defora.rom>
Date: Mon, 25 May 2009 23:39:07 +0200 (CEST)
From: khorben@defora.org
Reply-To: khorben@defora.org
To: gnats-bugs@gnats.NetBSD.org
Subject: fsck_ext2fs doesn't ignore the -P flag
X-Send-Pr-Version: 3.95

>Number:         41490
>Category:       bin
>Synopsis:       fsck_ext2fs doesn't ignore the -P flag
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    tron
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 25 23:00:00 +0000 2009
>Closed-Date:    Sat Sep 05 11:54:40 +0000 2009
>Last-Modified:  Sat Sep 05 11:54:40 +0000 2009
>Originator:     khorben@defora.org
>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:/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;

>Release-Note:

>Audit-Trail:
From: Pierre Pronchery <khorben@defora.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/41490: fsck_ext2fs doesn't ignore the -P flag
Date: Tue, 26 May 2009 01:20:19 +0200

 (the real originator e-mail address is this one instead)

 -- 
 khorben

Responsible-Changed-From-To: bin-bug-people->tron
Responsible-Changed-By: tron@NetBSD.org
Responsible-Changed-When: Sun, 16 Aug 2009 13:44:35 +0000
Responsible-Changed-Why:
I'll try to handle this PR.


From: Matthias Scheler <tron@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/41490 CVS commit: src/sbin/fsck_ext2fs
Date: Sun, 16 Aug 2009 13:50:54 +0000

 Module Name:	src
 Committed By:	tron
 Date:		Sun Aug 16 13:50:54 UTC 2009

 Modified Files:
 	src/sbin/fsck_ext2fs: main.c

 Log Message:
 Ignore the "-P" option as intended to make this work with e.g.
 "fsck_flags=-pP" in "/etc/rc.conf".

 Patch supplied by Pierre Pronchery in PR bin/41490.


 To generate a diff of this commit:
 cvs rdiff -u -r1.32 -r1.33 src/sbin/fsck_ext2fs/main.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->pending-pullups
State-Changed-By: tron@NetBSD.org
State-Changed-When: Sun, 16 Aug 2009 13:58:45 +0000
State-Changed-Why:
I've committed your patch and requested pullup into the "netbsd-5" branch.
Thanks a lot for your contribution.


From: Manuel Bouyer <bouyer@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/41490 CVS commit: [netbsd-5] src/sbin/fsck_ext2fs
Date: Sat, 5 Sep 2009 11:45:06 +0000

 Module Name:	src
 Committed By:	bouyer
 Date:		Sat Sep  5 11:45:06 UTC 2009

 Modified Files:
 	src/sbin/fsck_ext2fs [netbsd-5]: main.c

 Log Message:
 Pull up following revision(s) (requested by tron in ticket #914):
 	sbin/fsck_ext2fs/main.c: revision 1.33
 Ignore the "-P" option as intended to make this work with e.g.
 "fsck_flags=3D-pP" in "/etc/rc.conf".
 Patch supplied by Pierre Pronchery in PR bin/41490.


 To generate a diff of this commit:
 cvs rdiff -u -r1.32 -r1.32.2.1 src/sbin/fsck_ext2fs/main.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Manuel Bouyer <bouyer@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/41490 CVS commit: [netbsd-5-0] src/sbin/fsck_ext2fs
Date: Sat, 5 Sep 2009 11:45:20 +0000

 Module Name:	src
 Committed By:	bouyer
 Date:		Sat Sep  5 11:45:20 UTC 2009

 Modified Files:
 	src/sbin/fsck_ext2fs [netbsd-5-0]: main.c

 Log Message:
 Pull up following revision(s) (requested by tron in ticket #914):
 	sbin/fsck_ext2fs/main.c: revision 1.33
 Ignore the "-P" option as intended to make this work with e.g.
 "fsck_flags=3D-pP" in "/etc/rc.conf".
 Patch supplied by Pierre Pronchery in PR bin/41490.


 To generate a diff of this commit:
 cvs rdiff -u -r1.32 -r1.32.6.1 src/sbin/fsck_ext2fs/main.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: pending-pullups->closed
State-Changed-By: tron@NetBSD.org
State-Changed-When: Sat, 05 Sep 2009 11:54:40 +0000
State-Changed-Why:
Your patch has been committed and pulled up. Thanks a lot for your
contribution.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.