Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Jul 2001 11:26:59 +0200 (CEST)
From:      Maxime Henrion <mux@qualys.com>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/28937: [PATCH] fsck_msdosfs doesn't recognise -F flag
Message-ID:  <200107130926.f6D9Qxg45151@nebula.cybercable.fr>

next in thread | raw e-mail | index | archive | help

>Number:         28937
>Category:       bin
>Synopsis:       [PATCH] fsck_msdosfs doesn't recognise -F flag
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul 13 02:30:00 PDT 2001
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200107130926.f6D9Qxg45151>