From mux@qualys.com  Fri Jul 13 02:27:02 2001
Return-Path: <mux@qualys.com>
Received: from nebula.cybercable.fr (e250.dhcp212-198-25.noos.fr [212.198.25.250])
	by hub.freebsd.org (Postfix) with ESMTP id 07DDA37B405
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 13 Jul 2001 02:27:01 -0700 (PDT)
	(envelope-from mux@qualys.com)
Received: (from mux@localhost)
	by nebula.cybercable.fr (8.11.4/8.11.4) id f6D9Qxg45151;
	Fri, 13 Jul 2001 11:26:59 +0200 (CEST)
	(envelope-from mux)
Message-Id: <200107130926.f6D9Qxg45151@nebula.cybercable.fr>
Date: Fri, 13 Jul 2001 11:26:59 +0200 (CEST)
From: Maxime Henrion <mux@qualys.com>
Reply-To: Maxime Henrion <mux@qualys.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [PATCH] fsck_msdosfs doesn't recognise -F flag
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         28937
>Category:       bin
>Synopsis:       [PATCH] fsck_msdosfs doesn't recognise -F flag
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    obrien
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul 13 02:30:00 PDT 2001
>Closed-Date:    Thu Jul 19 11:29:02 PDT 2001
>Last-Modified:  Thu Jul 19 11:29:09 PDT 2001
>Originator:     Maxime Henrion
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
None
>Environment:
System: FreeBSD nebula.cybercable.fr 5.0-CURRENT FreeBSD 5.0-CURRENT #2: Wed Jul 11 11:36:48 CEST 2001 mux@nebula.cybercable.fr:/usr/src/sys/i386/compile/NEBULA i386


>Description:
	fsck_msdosfs doesn't recognise the flag -F which his passed to
	it since background fsck was enabled on -CURRENT.

>How-To-Repeat:
	Just boot your -CURRENT system with an MS-DOS partition mounted
	in /etc/fstab with the sixth field set (non-0, usually 2) and
	background_fsck set to yes (this is the default).

	The boot script will invoke fsck_msdosfs with the -F flag, thus
	causing fsck_msdosfs to print a usage message.  As it returns
	a non-0 exit code, it will not be invoked with -B later.

>Fix:
	This patch returns 8 if fsck_msdosfs is invoked with the
	flag -F as it is done with fsck_ifs (in which it defines
	EEXIT as 8 and return EEXIT).

--- fsck_msdosfs.patch begins here ---
--- /usr/src/sbin/fsck_msdosfs/main.c	Mon Jul  9 12:35:18 2001
+++ main.c	Tue Jul 10 01:33:58 2001
@@ -75,13 +75,17 @@
 	int ret = 0, erg;
 	int ch;
 
-	while ((ch = getopt(argc, argv, "pynf")) != -1) {
+	while ((ch = getopt(argc, argv, "fFnpy")) != -1) {
 		switch (ch) {
 		case 'f':
 			/*
 			 * We are always forced, since we don't
 			 * have a clean flag
 			 */
+			break;
+		case 'F':
+			/* We can never run in background */
+			exit(8);
 			break;
 		case 'n':
 			alwaysno = 1;
--- fsck_msdosfs.patch ends here ---
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->orbien 
Responsible-Changed-By: dd 
Responsible-Changed-When: Fri Jul 13 02:31:39 PDT 2001 
Responsible-Changed-Why:  
obrien imported fsck_msdosfs. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=28937 
Responsible-Changed-From-To: orbien->obrien 
Responsible-Changed-By: dd 
Responsible-Changed-When: Fri Jul 13 02:55:57 PDT 2001 
Responsible-Changed-Why:  
oops; original message: 

Responsible-Changed-From-To: freebsd-bugs->orbien 
Responsible-Changed-By: dd 
Responsible-Changed-When: Fri Jul 13 02:31:39 PDT 2001 
Responsible-Changed-Why:  
obrien imported fsck_msdosfs. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=28937 
State-Changed-From-To: open->closed 
State-Changed-By: obrien 
State-Changed-When: Thu Jul 19 11:29:02 PDT 2001 
State-Changed-Why:  
committed, thanks! 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=28937 
>Unformatted:
